init_logger

Contents

init_logger#

init_logger(curr_logger: Logger, log_lvl: int = 10, log_format: str = '%(asctime)s - [%(levelname)s] - %(message)s') None[source]#

Initialize a very basic logger to trace the first lines in the stream.

To be done before everything (like parsing log_file etc…)

Parameters:
  • curr_logger (logging.Logger) – Logger to be initialize

  • log_lvl (int) – Logging level to be set

  • log_format (str) – Logger format to be set

Example

>>> logger = logging.getLogger("logger_test")
>>> init_logger(logger, logging.INFO, '%(asctime)s - [%(levelname)s] - %(message)s')
>>> logger.info("MESSAGE")
2021-03-02 16:57:35 - [INFO] - MESSAGE