-
-
Notifications
You must be signed in to change notification settings - Fork 487
Open
Description
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.
def set_logger(logger):
"""
Set the global logger.
Parameters
----------
logger : logging.Logger
The custom logger to use.
Returns None
"""
# Check if the logger is a valid logger
if not isinstance(logger, logging.Logger):
raise ValueError("The logger must be an instance of logging.Logger")
# Bind the logger input to the global logger
global __logger
__logger = loggerFor example, popular logging libraries like loguru cannot be used with the current implementation, even though they provide all the necessary logging methods.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels