Skip to main content

Logger

The Python SDK uses Python’s standard logging module for diagnostic output. There is no custom logger protocol — the SDK obtains the "adaline" named logger with logging.getLogger("adaline") and writes debug, info, warning, and error messages to it.

Configuration via the constructor

Pass debug=True to the Adaline constructor to enable DEBUG-level logging with a StreamHandler that formats messages as [Adaline] LEVEL: message:
from adaline.main import Adaline

adaline = Adaline(debug=True)
# DEBUG and above are now printed to stderr

Configuring the logger yourself

For production setups you usually want to route the adaline logger through your application’s logging pipeline rather than the SDK’s default handler. Use the standard logging API:
import logging
from adaline.main import Adaline

logger = logging.getLogger("adaline")
logger.setLevel(logging.INFO)

# Send to your structured logger (e.g., structlog, loguru, or a file handler)
handler = logging.FileHandler("adaline.log")
handler.setFormatter(logging.Formatter("%(asctime)s %(levelname)s %(message)s"))
logger.addHandler(handler)

adaline = Adaline()  # picks up your handler — do NOT pass debug=True

Silencing SDK logs

By default (with debug=False) the SDK does not attach any handlers; it simply emits messages to the "adaline" named logger. If nothing in your app is configured to consume that logger, nothing is printed. To explicitly silence it:
import logging
logging.getLogger("adaline").setLevel(logging.CRITICAL + 1)

See Also