mistralai / client-python

Python client library for Mistral AI platform
Apache License 2.0
477 stars 103 forks source link

client_base.py overwrites logging.basicConfig #84

Closed lg900 closed 5 months ago

lg900 commented 7 months ago

The following code does not produce a log:

import logging
from mistralai.client import MistralClient

logger = logging.getLogger( __name__ )
logger.info( "Hello world" )

This is because of these lines in client_base.py:

logging.basicConfig(
    format="%(asctime)s %(levelname)s %(name)s: %(message)s",
    level=os.getenv("LOG_LEVEL", "ERROR"),
)

Modules should not setup the logging configuration, this should be removed or refactored so it is only called for main for example.

fuegoio commented 5 months ago

Fixed by #86. Thanks for reporting the issue and sorry for the delay!