feat(logging): add console color modes
This commit is contained in:
@@ -49,6 +49,7 @@ If set, CLAWDIS derives defaults (only when you haven’t set them explicitly):
|
||||
- Console output can be tuned separately via:
|
||||
- `logging.consoleLevel` (defaults to `info`, bumps to `debug` when `--verbose`)
|
||||
- `logging.consoleStyle` (`pretty` | `compact` | `json`)
|
||||
- `logging.consoleColor` (`auto` | `always` | `never`)
|
||||
|
||||
```json5
|
||||
{
|
||||
@@ -56,7 +57,8 @@ If set, CLAWDIS derives defaults (only when you haven’t set them explicitly):
|
||||
level: "info",
|
||||
file: "/tmp/clawdis/clawdis.log",
|
||||
consoleLevel: "info",
|
||||
consoleStyle: "pretty"
|
||||
consoleStyle: "pretty",
|
||||
consoleColor: "auto"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -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`)
|
||||
|
||||
Reference in New Issue
Block a user