bootstrap.Logger

class bootstrap.lib.logger.Logger[source]

The Logger class is a singleton. It contains all the utilities for logging variables in a key-value dictionary. It can also be considered as a replacement for the print function.

Logger(dir_logs='logs/mnist')
Logger().log_value('train_epoch.epoch', epoch)
Logger().log_value('train_epoch.mean_acctop1', mean_acctop1)
Logger().flush() # write the logs.json

Logger()("Launching training procedures") # written to logs.txt
> [I 2018-07-23 18:58:31] ...trap/engines/engine.py.80: Launching training procedures
flush()[source]
log_dict(group, dictionary, description='', stack_displacement=2, should_print=False, log_level=1)[source]
log_message(*message, log_level=0, break_line=True, print_header=True, stack_displacement=1)[source]
log_value(name, value, stack_displacement=2, should_print=False, log_level=1)[source]