Skip to main content
BackAnt ships a custom Logger class in api/helper/execution_tracking/Logger.py. It wraps Python’s standard logging module and automatically tags every log entry with the calling class and method name.

The Logger class

A singleton myLogger is pre-instantiated at the bottom of the file and imported wherever logging is needed.

Using the logger

Log levels

Auto-tagging

The Logger inspects the call stack and prepends the calling class and method name to every message:
This makes it easy to trace where a log line originated without adding class names manually.

Logger in repositories

The Repository base class and DBSession both use myLogger internally. Database operations are logged automatically:

Accessing logger in generated code

All generated services and repositories inject myLogger via the constructor:
Access it via self.logger inside the class.

Log output format

The default format is:
Example:
To change the format or level, update the basicConfig call in Logger.py.