mistralai/client-python

client_base.py overwrites logging.basicConfig

lg900 opened this issue · 1 comments

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.

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