pgn2json.logs package

Submodules

pgn2json.logs.setup_logging module

setup_logging.py: Set up the logging configuration.

pgn2json.logs.setup_logging.setup_logging(log_output_location: Path = PosixPath('pgn2json_log.txt'), console_logging_level: Literal['CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG'] = 'INFO', file_logging_level: Literal['CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG'] = 'DEBUG') None

Setup logging configuration.

Parameters:
  • log_output_location (Path, optional) – The path to the log file, by default Constants.DEFAULT_LOG_SAVE_PATH

  • console_logging_level (Constants.POSSIBLE_LOGGING_LEVELS, optional) – The logging level for the console handler, by default Constants.LOGGING_LEVEL_CONSOLE_DEFAULT

  • file_logging_level (Constants.POSSIBLE_LOGGING_LEVELS, optional) – The logging level for the file handler, by default Constants.LOGGING_LEVEL_LOGFILE_DEFAULT

Raises:

ValueError – If the logging level is invalid.

Examples

>>> setup_logging()
>>> setup_logging(console_logging_level="WARNING", file_logging_level="DEBUG")

Module contents

Logging package for the project.