feat(logging): add console color modes

This commit is contained in:
Peter Steinberger
2025-12-21 13:26:50 +00:00
parent 249b85af1e
commit 0146784e18
4 changed files with 49 additions and 8 deletions

View File

@@ -74,7 +74,8 @@ Subsystem loggers are created via `createSubsystemLogger("gateway")`.
Behavior:
- **Subsystem prefixes** on every line (e.g. `[gateway]`, `[canvas]`, `[tailscale]`)
- **Color only when TTY** (`process.stdout.isTTY` + `NO_COLOR` respected)
- **Subsystem colors** (stable per subsystem) plus level coloring
- **Color modes** (`logging.consoleColor`: `auto`/`always`/`never`; `auto` honors `NO_COLOR` and TTY)
- **Sub-loggers by subsystem** (auto prefix + structured field `{ subsystem }`)
- **`logRaw()`** for QR/UX output (no prefix, no formatting)
- **Console styles** (e.g. `pretty | compact | json`)