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

A console-compatible logger interface used by the [Adaline](/docs/reference/sdk/v2/typescript/classes/adaline) client and [Monitor](/docs/reference/sdk/v2/typescript/classes/monitor) for internal diagnostic output.

## Import

```typescript theme={null}
import type { Logger } from '@adaline/client';
```

## Definition

```typescript theme={null}
interface Logger {
  debug(message: string, ...args: unknown[]): void;
  info(message: string, ...args: unknown[]): void;
  warn(message: string, ...args: unknown[]): void;
  error(message: string, ...args: unknown[]): void;
}
```

***

## Methods

| Method                    | Description                                                               |
| ------------------------- | ------------------------------------------------------------------------- |
| `debug(message, ...args)` | Verbose diagnostic information, useful during development.                |
| `info(message, ...args)`  | General operational messages (e.g., flush completed, deployment fetched). |
| `warn(message, ...args)`  | Potential issues that don't prevent operation (e.g., retry attempts).     |
| `error(message, ...args)` | Failures that need attention (e.g., API errors, flush failures).          |

Any object that implements these four methods is a valid `Logger`. This includes the built-in `console` object as well as popular logging libraries like [Winston](https://github.com/winstonjs/winston), [Pino](https://github.com/pinojs/pino), and [Bunyan](https://github.com/trentm/node-bunyan).

***

## Usage

### Using `debug: true`

The simplest way to enable logging is the `debug` shortcut, which uses `console` as the logger:

```typescript theme={null}
import { Adaline } from '@adaline/client';

const adaline = new Adaline({ debug: true });
```

### Passing `console` directly

Equivalent to `debug: true`:

```typescript theme={null}
import { Adaline } from '@adaline/client';

const adaline = new Adaline({ logger: console });
```

### Custom logger

Provide any object that satisfies the `Logger` interface:

```typescript theme={null}
import { Adaline } from '@adaline/client';
import type { Logger } from '@adaline/client';

const logger: Logger = {
  debug: (msg, ...args) => console.debug(`[adaline] ${msg}`, ...args),
  info:  (msg, ...args) => console.info(`[adaline] ${msg}`, ...args),
  warn:  (msg, ...args) => console.warn(`[adaline] ${msg}`, ...args),
  error: (msg, ...args) => console.error(`[adaline] ${msg}`, ...args),
};

const adaline = new Adaline({ logger });
```

### With a logging library

Works with any library that exposes the standard log-level methods:

```typescript theme={null}
import { Adaline } from '@adaline/client';
import pino from 'pino';

const logger = pino({ level: 'debug' });
const adaline = new Adaline({ logger });
```

***

## See Also

* [Adaline](/docs/reference/sdk/v2/typescript/classes/adaline) — accepts `logger` and `debug` in its constructor options
