Skip to content

✨ Add --target flag to logs for metrics and dockerd#14

Merged
bdsoha merged 2 commits into
mainfrom
feature/logs-component-targets
May 31, 2026
Merged

✨ Add --target flag to logs for metrics and dockerd#14
bdsoha merged 2 commits into
mainfrom
feature/logs-component-targets

Conversation

@bdsoha
Copy link
Copy Markdown
Member

@bdsoha bdsoha commented May 31, 2026

Adds ws-cli logs --target=<main|metrics|docker> so the metrics exporter
and in-container Docker daemon logs are inspectable through the same
surface as workspace.log.

  • logger.NewReader(tail, level, target) resolves the path via
    config.MustResolve("logging", target+"_file") — the YAML logging
    group is the registry, no internal target map.
  • --target is long-form only (no short alias); invalid targets are
    rejected with the same slices.Contains + styles.PrintErrorWithOptions
    pattern as --level.
  • Bare ws-cli logs keeps reading the main log (default --target=main).
  • Version bumped to 0.0.57 (auto-tags on merge).

PR-1 of the lockstep pair (workspace consumes the new tag + adds the
WS_LOGGING_{METRICS,DOCKER}_FILE env vars).

bdsoha added 2 commits May 31, 2026 12:02
Resolve the log path via config.MustResolve("logging", target+"_file")
so the YAML logging group is the registry — no internal target map.
--target is long-form only (no short alias); invalid targets are
rejected with the same slices.Contains + PrintErrorWithOptions pattern
as --level. Bare `ws-cli logs` keeps reading the main log.
@bdsoha bdsoha merged commit cff3286 into main May 31, 2026
3 checks passed
@bdsoha bdsoha deleted the feature/logs-component-targets branch May 31, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant