You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently in the set_logger() function, there is a type check that requires the logger to be an instance of logging.Logger. However, this restriction prevents the use of third-party logging libraries that don't inherit from logging.Logger but provide compatible logging interfaces.
defset_logger(logger):
""" Set the global logger. Parameters ---------- logger : logging.Logger The custom logger to use. Returns None """# Check if the logger is a valid loggerifnotisinstance(logger, logging.Logger):
raiseValueError("The logger must be an instance of logging.Logger")
# Bind the logger input to the global loggerglobal__logger__logger=logger
For example, popular logging libraries like loguru cannot be used with the current implementation, even though they provide all the necessary logging methods.
Currently in the
set_logger()
function, there is a type check that requires the logger to be an instance oflogging.Logger
. However, this restriction prevents the use of third-party logging libraries that don't inherit fromlogging.Logger
but provide compatible logging interfaces.For example, popular logging libraries like
loguru
cannot be used with the current implementation, even though they provide all the necessary logging methods.https://loguru.readthedocs.io/en/stable/api.html
The text was updated successfully, but these errors were encountered: