basicsr.utils.logger¶
- class basicsr.utils.logger.MessageLogger(opt, start_iter=1, tb_logger=None)[source]¶
Bases:
object
Message logger for printing.
- Parameters:
opt (dict) – Config. It contains the following keys: name (str): Exp name. logger (dict): Contains ‘print_freq’ (str) for logger interval. train (dict): Contains ‘total_iter’ (int) for total iters. use_tb_logger (bool): Use tensorboard logger.
start_iter (int) – Start iter. Default: 1.
(obj (tb_logger) – tb_logger): Tensorboard logger. Default: None.
- basicsr.utils.logger.get_env_info()[source]¶
Get environment information.
Currently, only log the software version.
- basicsr.utils.logger.get_root_logger(logger_name='basicsr', log_level=20, log_file=None)[source]¶
Get the root logger.
The logger will be initialized if it has not been initialized. By default a StreamHandler will be added. If log_file is specified, a FileHandler will also be added.
- Parameters:
logger_name (str) – root logger name. Default: ‘basicsr’.
log_file (str | None) – The log filename. If specified, a FileHandler will be added to the root logger.
log_level (int) – The root logger level. Note that only the process of rank 0 is affected, while other processes will set the level to “Error” and be silent most of the time.
- Returns:
The root logger.
- Return type:
logging.Logger