json2graph.modules.logger

This module provides functions for configuring a logger that outputs messages to both the console and a log file. The logger can be customized based on different execution modes, allowing you to control the log level.

Module Contents

Functions

logger_get_date_time()

Return a string in a specified format with date and time.

initialize_logger([execution_mode])

Create and initialize logger. The created logger is called 'execution-logger'.

json2graph.modules.logger.logger_get_date_time()

Return a string in a specified format with date and time.

Returns:

Formatted date and time. Format example: 2022.10.23-14.43

Return type:

str

json2graph.modules.logger.initialize_logger(execution_mode='script')

Create and initialize logger. The created logger is called ‘execution-logger’. Different triggers are defined for each execution mode:

  • script: INFO

  • import: ERROR

  • test: ERROR

Parameters:

execution_mode (str) – Information about execution mode. Valid values are ‘script’, ‘import’ and ‘test’.

Returns:

Created logger called ‘execution-logger’.

Return type:

logging.Logger