# LogEvent

Type alias

Source: https://github.com/playcanvas/splat-transform/blob/b6424a5b3b929695fbaafe738a995adb1240d675/src/lib/utils/logger.ts#L31

Semantic event delivered to a [Renderer](https://api.playcanvas.com/splat-transform/interfaces/Renderer.md). Renderers can filter, format
and display these as they wish.

`scopeStart` / `scopeEnd` represent the open/close of a [Group](https://api.playcanvas.com/splat-transform/interfaces/Group.md).
They carry optional `index` / `total` fields when the scope is part of a
numbered series, which renderers can use to switch to a `[N/T] name` style.

`barStart` / `barTick` / `barEnd` represent a determinate progress bar.
The bar's `name` is repeated on every event so the renderer can keep its
label stable across in-place updates while tracking progress via `current`
and `total`.

`output` is the pipeable channel: each event represents a single logical
unit of output (typically one line - or a multi-line block treated as a
unit) that the renderer is expected to terminate with a newline. Callers
should not include a trailing `\n` themselves.

```ts
type LogEvent = { depth: number; index?: number; kind: "scopeStart"; name: string; total?: number } | { depth: number; durationMs: number; failed?: boolean; index?: number; kind: "scopeEnd"; name: string; total?: number } | { depth: number; kind: "barStart"; name: string; total: number } | { current: number; depth: number; kind: "barTick"; name: string; total: number } | { current: number; depth: number; durationMs: number; failed?: boolean; kind: "barEnd"; name: string; total: number } | { depth: number; kind: "message"; level: MessageKind; text: string } | { kind: "output"; text: string }
```
