agent_logic.utils.logger

Logging utilities for the logic package.

This module provides consistent logging configuration across the logic package. It offers functions to create and configure loggers with consistent formatting, as well as to control the logging level globally for the entire package.

Functions

get_logger(name[, level])

Get a configured logger instance.

set_global_log_level(level)

Set the log level for all loggers in the logic package.

agent_logic.utils.logger.get_logger(name, level=None)[source]

Get a configured logger instance.

Creates or retrieves a logger with the given name and configures it with appropriate formatting and log level.

Parameters:
  • name (str) – Name of the logger (typically module name)

  • level (Optional[int]) – Logging level (if None, uses INFO)

Return type:

Logger

Returns:

Configured logger instance ready for use

agent_logic.utils.logger.set_global_log_level(level)[source]

Set the log level for all loggers in the logic package.

This function affects all existing loggers in the logic namespace and sets their level to the specified value.

Parameters:

level (int) – Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL) Example: logging.DEBUG or logging.ERROR

Return type:

None

Example

>>> from logic.utils.logger import set_global_log_level
>>> import logging
>>> set_global_log_level(logging.DEBUG)  # Enable debug logging