> ## Documentation Index
> Fetch the complete documentation index at: https://allhandsai-extend-api-reference-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# openhands.sdk.logger

> API reference for openhands.sdk.logger module

### get\_logger()

Get a logger instance for the specified module.

This function returns a configured logger that inherits from the root logger
setup. The logger supports both Rich formatting for human-readable output
and JSON formatting for machine processing, depending on environment configuration.

* Parameters:
  `name` – The name of the module, typically **name**.
* Returns:
  A configured Logger instance.

#### Example

```pycon theme={null}
>>> from openhands.sdk.logger import get_logger
>>> logger = get_logger(__name__)
>>> logger.info("This is an info message")
>>> logger.error("This is an error message")
```

### rolling\_log\_view()

Temporarily attach a rolling view handler that renders the last N log lines.

* Local TTY & not CI & not JSON: pretty, live-updating view (Rich.Live)
* CI / non-TTY: plain line-by-line (no terminal control)
* JSON mode: buffer only; on exit emit ONE large log record with the full snapshot.

### setup\_logging()

Configure the root logger. All child loggers inherit this setup.


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