# logViewerController

> The browser half of the log viewer: opens a failed job on its first error, searches every line (painting matches through the CSS Custom Highlight API, stepping with Enter and ⇧Enter), and streams a live step's lines in while the log follows its tail.

```ts
import { logViewerController } from "@sdxc/ui/app";
```

Wires the `LogViewer` the host sits in: search over every line, each live step's stream, and
following the tail; it all detaches when the host unmounts.

## Signature

```ts
logViewerController(options: LogViewerBehavior.Options): MixinDescriptor<HTMLElement>
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `options` | `LogViewerBehavior.Options` | The counter's copy. |

## Examples

```tsx
<div hidden mix={[logViewerController({ matches: "{index} of {count}", noMatches: "No results" })]} />
```

## Used with it

The events, constants and types its module publishes, each imported from `@sdxc/ui/app` too.

### LogViewerBehavior.Options

Plain data only, since the options cross into the browser with the viewer's island.

#### Signature

```ts
type LogViewerBehavior.Options = {
		/** The counter, with `{index}` and `{count}` replaced. */
		matches: string;
		/** Shown in place of the counter when nothing matches. */
		noMatches: string;
	}
```
