BasicLogger#

class wattson.util.basic_logger.BasicLogger(name: str, fake_logger: bool = False)#

Bases: Logger

Methods

__init__

Initialize the logger with a name and an optional level.

add_contexts

getChild

Get a logger which is a descendant to this one.

__init__(name: str, fake_logger: bool = False)#

Initialize the logger with a name and an optional level.

getChild(suffix: str)#

Get a logger which is a descendant to this one.

This is a convenience method, such that

logging.getLogger(‘abc’).getChild(‘def.ghi’)

is the same as

logging.getLogger(‘abc.def.ghi’)

It’s useful, for example, when the parent logger is named using __name__ rather than a literal string.