-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
The logger is in every class in the same way. These are four lines in each class __init__ function that could be a single line standardized across all classes that use the logger.
if logger is None:
logger = setup_logger(__name__, level=loglevel, log_dir=logdir, console=console)
self.logger = logger
self.verbose = verboseAdditionally, writing entries in this logger requires a verbosity check inside the class for each chunk of logging entries. This makes the code ugly. It would be great if the verbosity checks are handled within a custom logging class.
Instead of:
if some_check:
if verbose:
logger.info("message")
some_function()Just have:
if some_check:
logger.info("message")
some_function()Where the verbosity check would occur in the logger class.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request