Skip to content

logger.py


pycmtensor.logger

PyCMTensor logger module

This module sets the logging state of the program. Verbosity is defined by set_level()

Example Usage

# Set the logger level to DEBUG
set_level(DEBUG)

# Get the effective level of the logger
level = get_effective_level()

# Log a message at the INFO level
info("This is an informational message")

# Log a message at the WARNING level
warning("This is a warning message")

Inputs

  • level (int): The level of the logger to be set. It can be one of the predefined levels: DEBUG, INFO, WARNING, ERROR, or CRITICAL.

Outputs

  • None

set_level(level)

Set the level of the logger. The higher the number, the higher the verbosity.

Parameters:

Name Type Description Default
level int

the level of the logger - DEBUG = 10 - INFO = 20 (DEFAULT) - WARNING = 30 - ERROR = 40 - CRITICAL = 50

required

get_effective_level()

Gets the level of the logger