fix(logging): simplify tty color detection

This commit is contained in:
Peter Steinberger
2025-12-21 13:34:13 +00:00
parent 0146784e18
commit a8629e1855
4 changed files with 9 additions and 32 deletions

View File

@@ -49,7 +49,6 @@ If set, CLAWDIS derives defaults (only when you havent 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
{
@@ -57,8 +56,7 @@ If set, CLAWDIS derives defaults (only when you havent set them explicitly):
level: "info",
file: "/tmp/clawdis/clawdis.log",
consoleLevel: "info",
consoleStyle: "pretty",
consoleColor: "auto"
consoleStyle: "pretty"
}
}
```

View File

@@ -75,7 +75,7 @@ Behavior:
- **Subsystem prefixes** on every line (e.g. `[gateway]`, `[canvas]`, `[tailscale]`)
- **Subsystem colors** (stable per subsystem) plus level coloring
- **Color modes** (`logging.consoleColor`: `auto`/`always`/`never`; `auto` honors `NO_COLOR` and TTY)
- **Color only when TTY** (`process.stdout.isTTY`/`process.stderr.isTTY`), respects `NO_COLOR`
- **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`)