# Logging

Write debug output from workflow steps.

Use standard console methods directly in your workflow code. `console.log()` messages appear in the **DEBUG** output of the test runner and in run history details.

## Usage

```js
export class Workflow {
  async start(data, _headers, _api) {
    console.log('Order received:', data.id);
    console.log('Customer:', data.email, 'Total:', data.total_price);
  }
}
```

Multiple arguments are joined with a space, exactly as they would be in normal JavaScript runtime logging.

## Console methods

The most useful console methods are captured:

| Method | Prefix in DEBUG output |
| --- | --- |
| `console.log()` | (none) |
| `console.info()` | ℹ️ |
| `console.warn()` | ⚠️ |
| `console.error()` | ❌ |

Use `console.warn()` and `console.error()` to draw attention to recoverable problems and failures respectively. All output appears in the same DEBUG array in the order it was written.

## Logging objects

Pass objects directly — they are serialised automatically in the output:

```js
console.log('Order details:', { id: data.id, status: data.financial_status });
```

## Live runs vs test runs

In live runs, `console.log()` output is stored as part of the run record and is visible in the **Runs** panel in the dashboard. In test runs, it appears immediately in the test result panel.

Output is captured per step — each step shows its own DEBUG array.