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

# harnest.logging

> Public Python signatures, fields, and methods.

[All Python modules](https://usefused.com/docs/harnest/reference/api/overview.md) · [Import and compatibility guidance](https://usefused.com/docs/harnest/build/python-imports.md)

## Exports

| Name | Kind |
| - | - |
| [`Logger`](#logger) | Class |
| [`get_logger`](#get_logger) | Function |

## Logger

A small structured facade over an agent-scoped standard logger.

Obtain this object from the owning Harnest API; its constructor includes runtime bindings.

Fields (`—` means no declared default):

| Field | Type | Default |
| - | - | - |
| `name` | `str` | `—` |

> [accordion] Example
>
> ```python theme={null}
> from harnest.logging import Logger
>
> logger: Logger  # returned by Harnest, not constructed directly
> ```

### Logger.stdlib

Return the underlying standard-library logger.

> [accordion] Example
>
> ```python theme={null}
> from harnest.logging import Logger
>
> logger: Logger
> value = logger.stdlib
> ```

### Logger.bind

```python theme={null}
Logger.bind(**attributes: Any) -> 'Logger'
```

Return a logger carrying immutable attributes on every record.

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `**attributes` | `Any` | Optional |
>
> ```python theme={null}
> from harnest.logging import Logger
>
> logger: Logger
> logger = logger.bind()
> ```

### Logger.log

```python theme={null}
Logger.log(level: int, event: str, *args: Any, exc_info: Any = None, **attributes: Any) -> None
```

Emit a structured event at an explicit standard logging level.

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `level` | `int` | Required |
> | `event` | `str` | Required |
> | `*args` | `Any` | Optional |
> | `exc_info` | `Any` | `None` |
> | `**attributes` | `Any` | Optional |
>
> ```python theme={null}
> from harnest.logging import Logger
>
> logger: Logger
> logger.log(level=..., event=...)
> ```

### Logger.debug

```python theme={null}
Logger.debug(event: str, *args: Any, **attributes: Any) -> None
```

Emit a structured debug event.

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `event` | `str` | Required |
> | `*args` | `Any` | Optional |
> | `**attributes` | `Any` | Optional |
>
> ```python theme={null}
> from harnest.logging import Logger
>
> logger: Logger
> logger.debug(event=...)
> ```

### Logger.info

```python theme={null}
Logger.info(event: str, *args: Any, **attributes: Any) -> None
```

Emit a structured informational event.

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `event` | `str` | Required |
> | `*args` | `Any` | Optional |
> | `**attributes` | `Any` | Optional |
>
> ```python theme={null}
> from harnest.logging import Logger
>
> logger: Logger
> logger.info(event=...)
> ```

### Logger.warning

```python theme={null}
Logger.warning(event: str, *args: Any, **attributes: Any) -> None
```

Emit a structured warning event.

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `event` | `str` | Required |
> | `*args` | `Any` | Optional |
> | `**attributes` | `Any` | Optional |
>
> ```python theme={null}
> from harnest.logging import Logger
>
> logger: Logger
> logger.warning(event=...)
> ```

### Logger.error

```python theme={null}
Logger.error(event: str, *args: Any, **attributes: Any) -> None
```

Emit a structured error event.

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `event` | `str` | Required |
> | `*args` | `Any` | Optional |
> | `**attributes` | `Any` | Optional |
>
> ```python theme={null}
> from harnest.logging import Logger
>
> logger: Logger
> logger.error(event=...)
> ```

### Logger.critical

```python theme={null}
Logger.critical(event: str, *args: Any, **attributes: Any) -> None
```

Emit a structured critical event.

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `event` | `str` | Required |
> | `*args` | `Any` | Optional |
> | `**attributes` | `Any` | Optional |
>
> ```python theme={null}
> from harnest.logging import Logger
>
> logger: Logger
> logger.critical(event=...)
> ```

### Logger.exception

```python theme={null}
Logger.exception(event: str, *args: Any, **attributes: Any) -> None
```

Emit an error event carrying the active exception traceback.

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `event` | `str` | Required |
> | `*args` | `Any` | Optional |
> | `**attributes` | `Any` | Optional |
>
> ```python theme={null}
> from harnest.logging import Logger
>
> logger: Logger
> logger.exception(event=...)
> ```

## get\_logger

Create a structured logger in Harnest's agent logging namespace.

```python theme={null}
get_logger(name: str = 'agent', **attributes: Any) -> Logger
```

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `name` | `str` | `'agent'` |
> | `**attributes` | `Any` | Optional |
>
> ```python theme={null}
> from harnest.logging import get_logger
>
> logger = get_logger()
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.