> For the complete documentation index, see [llms.txt](https://tarmac.gitbook.io/tarmac-framework/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tarmac.gitbook.io/tarmac-framework/capabilities/logger.md).

# Logger

The Logger capability provides WASM functions with the ability to log arbitrary data. Much like a traditional logger framework, this capability offers multiple log levels.

By default Debug and Trace level logs are disabled. To enable these log levels to consult the configuration options for Tarmac.

## Error

Critical errors within the system.

```golang
_, err := wapc.HostCall("tarmac", "logger", "error", []byte("This is the data that should be logged"))
```

### Interface Details

| Namespace | Capability | Function | Input       | Output |
| --------- | ---------- | -------- | ----------- | ------ |
| `tarmac`  | `logger`   | `error`  | Log Message | `nil`  |

## Warn

Non-critical errors within the system.

```golang
_, err := wapc.HostCall("tarmac", "logger", "warn", []byte("This is the data that should be logged"))
```

### Interface Details

| Namespace | Capability | Function | Input       | Output |
| --------- | ---------- | -------- | ----------- | ------ |
| `tarmac`  | `logger`   | `warn`   | Log Message | `nil`  |

## Info

Informational logs.

```golang
_, err := wapc.HostCall("tarmac", "logger", "info", []byte("This is the data that should be logged"))
```

### Interface Details

| Namespace | Capability | Function | Input       | Output |
| --------- | ---------- | -------- | ----------- | ------ |
| `tarmac`  | `logger`   | `info`   | Log Message | `nil`  |

## Debug

Request level errors & informational logs. Disabled by default, calls to Debug logging are ignored unless `debug` is enabled for the Tarmac host.

```golang
_, err := wapc.HostCall("tarmac", "logger", "debug", []byte("This is the data that should be logged"))
```

### Interface Details

| Namespace | Capability | Function | Input       | Output |
| --------- | ---------- | -------- | ----------- | ------ |
| `tarmac`  | `logger`   | `debug`  | Log Message | `nil`  |

## Trace

Low-level details of execution. Disabled by default, calls to Trace logging are ignored unless `trace` is enabled for the Tarmac host.

```golang
_, err := wapc.HostCall("tarmac", "logger", "trace", []byte("This is the data that should be logged"))
```

### Interface Details

| Namespace | Capability | Function | Input       | Output |
| --------- | ---------- | -------- | ----------- | ------ |
| `tarmac`  | `logger`   | `trace`  | Log Message | `nil`  |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://tarmac.gitbook.io/tarmac-framework/capabilities/logger.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
