-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Logging is messy. Let's clean it up somehow.
This is a broad issue. Currently we need to do something like this:
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
ch.setFormatter(formatter)
logger.addHandler(ch)at some global level (currently the module level), so that we can do stuff like this within that scope:
logger.debug("Debug statement here")I'd really prefer not to have that cruft in every module, so at the least we need to refactor it out somehow. Suggestions?
Reactions are currently unavailable