summaryrefslogtreecommitdiffstats
path: root/g4f/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'g4f/__init__.py')
-rw-r--r--g4f/__init__.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/g4f/__init__.py b/g4f/__init__.py
index d77fe760..f59a1446 100644
--- a/g4f/__init__.py
+++ b/g4f/__init__.py
@@ -1,6 +1,7 @@
from __future__ import annotations
import os
+import logging
from . import debug, version
from .models import Model
@@ -12,6 +13,14 @@ from .providers.types import ProviderType
from .providers.base_provider import AsyncGeneratorProvider
from .client.service import get_model_and_provider, get_last_provider
+#Configure "g4f" logger
+logger = logging.getLogger(__name__)
+log_handler = logging.StreamHandler()
+log_handler.setFormatter(logging.Formatter(logging.BASIC_FORMAT))
+logger.addHandler(log_handler)
+
+logger.setLevel(logging.ERROR)
+
class ChatCompletion:
@staticmethod
def create(model : Union[Model, str],