tlo.logging package

Module contents

disable(level)[source]
getLogger(name='tlo')[source]

Returns a TLO logger of the specified name

set_output_file(log_path: pathlib.Path) logging.FileHandler[source]

Add filehandler to logger

Parameters

log_path – path for file

Returns

filehandler object

init_logging(add_stdout_handler=True)[source]

Initialise default logging with stdout stream

set_simulation(simulation)[source]

Inject simulation into logger for structured logging, called by the simulation :param simulation: :return:

set_logging_levels(custom_levels: Dict[str, int], modules: Iterable[str])[source]

Set custom logging levels for disease modules

Parameters
  • custom_levels – Dictionary of modules and their level, ‘*’ can be used as a key for all modules

  • modules – string values of all registered modules