-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
The current logger adapter uses log/slog's default text handler, which outputs structured key-value pairs (e.g., level=INFO msg="..."). This style conflicts with the polished, human-readable output generated by the linear renderer used during same run.
We need to refactor the logger to produce visually consistent, "pretty" output for standalone commands like clean and version. The new implementation should strip away structured logging artifacts (timestamps, levels, keys) in favor of styled, direct text that respects the user's terminal environment.
Goals
- Visual Consistency: Ensure all CLI output shares the same aesthetic (colors, spacing, typography) as the build execution logs.
- Shared Design System: Centralize color and icon definitions to prevent visual drift between the TUI, linear renderer, and logger.
- TTY Awareness: Strictly respect
NO_COLORand terminal capabilities.
Acceptance Criteria
1. Style & Formatting
- Info Logs:
- Icon: None. (Text only).
- Color: Default/Slate (Neutral).
- Format:
<Message>(No timestamp, nolevel=key).
- Warn Logs:
- Icon:
!(or similar warning symbol). - Color: Yellow.
- Format:
<Icon> <Message>.
- Icon:
- Error Logs:
- Icon:
✗(Cross mark). - Color: Red.
- Format:
<Icon> <Message>.
- Icon:
- Prefixes: The output must NOT include tool prefixes (e.g., remove
[same],[cli]).
2. Implementation
- Shared Package: Extract colors (
colorIris,colorRed, etc.) and icons frominternal/adapters/tui/styles.gointo a new shared package (e.g.,internal/ui/style) usable by all adapters. - Logger Adapter: Refactor
internal/adapters/loggerto removeslog.NewTextHandler. Implement a custom handler (or wrapper) usinggithub.com/muesli/termenvto render styled text directly toos.Stderr. - Environment: The logger must detect TTY capabilities and respect the
NO_COLORenvironment variable (stripping ANSI codes if set).
3. Verification
- Running
same cleanproduces output similar to:(Note: No icons for these info logs, noRemoving build info store... removed build info storelevel=keys).
Metadata
Metadata
Assignees
Labels
No labels