> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.conductorquantum.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.conductorquantum.com/_mcp/server.

# stanza.logger.data_logger



## Module Contents

### Classes

| Name | Description |
|------|-------------|
| [`DataLogger`](#stanzaloggerdata_loggerdatalogger) | Logger for data collection. |

### Data

`logger`

### API

```python
stanza.logger.data_logger.logger
```

**Value**: `getLogger(...)`


```python
class stanza.logger.data_logger.DataLogger(routine_name: str, base_dir: str | pathlib.Path, name: str = 'logger', formats: list[str] | None = None, routine_dir_name: str | None = None, compression: str | None = None, compression_level: int = 6, buffer_size: int = 1000, auto_flush_interval: float | None = 30.0, bokeh_backend: stanza.plotter.backends.bokeh.BokehBackend | None = None)
```

Logger for data collection.

```python
_WRITER_REGISTRY
```

**Value**: `None`


```python
set_base_directory(base_dir: str | pathlib.Path) -> None
```

Update the base directory where sessions will be created.


```python
_auto_enable_live_plotting() -> None
```

Auto-enable live plotting if configured.


```python
_find_config_file() -> pathlib.Path | None
```

Search up directory tree for .stanza/live_plot_config.json.


```python
_slugify(name: str) -> str
```

Slugify a name.


```python
create_session(
    session_id: str | None = None, group_name: str | None = None
) -> stanza.logger.session.LoggerSession
```

Create a new logger session.


```python
get_session(session_id: str) -> stanza.logger.session.LoggerSession | None
```

Get a session by ID.


```python
active_sessions: list[stanza.logger.session.LoggerSession]
```

Get all active sessions.


```python
current_session: stanza.logger.session.LoggerSession | None
```

Get the current session.


```python
close_session(session_id: str) -> None
```

Close and remove a specific session.


```python
close_all_sessions() -> None
```

Close all active sessions.


```python
finalize() -> None
```

Finalize the data logger.


```python
__enter__() -> stanza.logger.data_logger.DataLogger
```

Enter the data logger context.


```python
__exit__(
    exc_type: type[BaseException] | None,
    exc_value: BaseException | None,
    traceback: typing.Any
) -> None
```

Exit the data logger context.


```python
__repr__() -> str
```