> ## Documentation Index
> Fetch the complete documentation index at: https://www.adaline.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Logger

# 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`:

```python theme={null}
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:

```python theme={null}
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:

```python theme={null}
import logging
logging.getLogger("adaline").setLevel(logging.CRITICAL + 1)
```

## See Also

* [Adaline class](/docs/reference/sdk/v2/python/classes/adaline) — constructor accepts `debug: bool`
* Python standard library: [`logging`](https://docs.python.org/3/library/logging.html)
