langgraph_agent_toolkit.helper.logging module

class langgraph_agent_toolkit.helper.logging.DuplicateFilter[source][source]

Bases: object

Filter duplicate log messages.

__init__()[source][source]
class langgraph_agent_toolkit.helper.logging.Formatter(debug=False)[source][source]

Bases: object

Format log messages by log level.

Initialize the formatter.

Parameters:

debug (bool) – Use the detailed format with function and line data.

__init__(debug=False)[source][source]

Initialize the formatter.

Parameters:

debug (bool) – Use the detailed format with function and line data.

format(record)[source][source]

Format a log record.

Parameters:

record – Log record.

Returns:

Formatted log message.

Return type:

str

class langgraph_agent_toolkit.helper.logging.SingletonMeta[source][source]

Bases: type

Create one LoggerConfig instance.

class langgraph_agent_toolkit.helper.logging.LoggerConfig(*args, **kwargs)[source][source]

Bases: object

Configure and manage the singleton logger.

WARN_ONCE_NO = 25
DEPRECATED_NO = 26
__init__()[source][source]
configure_file_logging(log_file)[source][source]

Add file logging to the logger configuration.

Parameters:

log_file (str) – Log file path.

Return type:

None

property logger

Get the configured logger.

Returns:

Configured logger.

Return type:

loguru_logger

langgraph_agent_toolkit.helper.logging.warn_once(message, *args, **kwargs)[source][source]

Log a warning message once.

Parameters:
  • message (str) – Warning message.

  • *args – Positional arguments.

  • **kwargs – Keyword arguments.

langgraph_agent_toolkit.helper.logging.log_deprecated(message, *args, **kwargs)[source][source]

Log a deprecation warning.

Parameters:
  • message (str) – Deprecation message.

  • *args – Positional arguments.

  • **kwargs – Keyword arguments.

class langgraph_agent_toolkit.helper.logging.InterceptHandler(level=NOTSET)[source][source]

Bases: Handler

Redirect FastAPI’s built-in logger to Loguru.

Initializes the instance - basically setting the formatter to None and the filter list to empty.

emit(record)[source][source]
Parameters:

record (LogRecord | None)

Return type:

None

langgraph_agent_toolkit.helper.logging.get_logger(log_file=None)[source][source]

Get the configured logger and optionally add file logging.

Parameters:

log_file (Optional[str]) – Optional log file path.

Returns:

Configured logger.

Return type:

logger