Skip to content

[Feature]: Unified log/slog Logging, CLI/Desktop Flag Contract & Operational Telemetry #1841

Open

Description

@skevetter

Summary

Consolidate and unify logging (log/slog), CLI/Desktop output & logging flags (STDOUT vs STDERR), and operational telemetry/analytics across the Devsy CLI, Desktop app, and all 15 external provider repositories in devsy-org (plus devsy-runtime-sdk and built-in drivers).


1. Uniform CLI & Desktop Flag Contract (STDOUT vs STDERR)

Concern Stream Canonical Flag Environment Variable (BindEnv) Allowed Values Default
Log Verbosity STDERR --log-level DEVSY_LOG_LEVEL (fallback: context LOG_LEVEL) error, warn, info, debug, trace warn (CLI) / info (remote agent)
Log Encoding STDERR --log-format DEVSY_LOG_FORMAT auto, text, json, logfmt (alias: plain -> text) auto (text on TTY, json when piped / DEVSY_UI=true / internal)
Result Format STDOUT --result-format DEVSY_RESULT_FORMAT auto, text, plain, json auto (plain/text on TTY, json when piped / DEVSY_UI=true)
Live Progress STDOUT --no-status DEVSY_NO_STATUS true, false false

Removed Redundant Flags

  • -v / -vv / -vvv (--verbose) -> Replaced by --log-level=info|debug|trace
  • --debug ($DEVSY_DEBUG) -> Replaced by --log-level=debug
  • -q / --quiet -> Replaced by --log-level=error (and --no-status)
  • --log-output (and invalid --log-output=raw usages) -> Replaced by --log-format
  • Per-command --json (e.g. devsy provider versions --json) -> Replaced by global --result-format

2. Organization-Wide Repository Audit (devsy-org — All 37 Repositories)

Category Repositories Current Logging Mechanism Planned Action
1. Core Monorepo (1) devsy pkg/log (zap), desktop/src/main/logging.ts Migrate pkg/log to log/slog, unify CLI/Desktop flags, streamer, status, and telemetry (#1842–#1848).
2. Go Providers Importing devsy/pkg/log (12) Machine (8): devsy-provider-aws, devsy-provider-gcloud, devsy-provider-azure, devsy-provider-digitalocean, devsy-provider-civo, devsy-provider-terraform, devsy-provider-lima, devsy-provider-orbstack
Custom Driver (3): devsy-provider-kubernetes (also has direct go.uber.org/zap in go.mod), devsy-provider-ecs, devsy-provider-dockerless
Proxy (1): devsy-provider-ssh
All 12 use cmd/root.go:
cfg := log.Config{Verbosity: 1}
if os.Getenv("DEVSY_DEBUG") == "true" { cfg.Debug = true }
log.Init(cfg)
Add log.InitProvider(providerName) in devsy/pkg/log (retaining Verbosity/Debug as deprecated compatibility shims on log.Config), bump github.com/devsy-org/devsy in all 12 repos, switch cmd/root.go to log.InitProvider("<name>"), and remove direct zap from devsy-provider-kubernetes (#1845).
3. Standalone Go Machine Providers (2) devsy-provider-docker-sandbox, devsy-provider-harvester Standalone Go binaries (do not import devsy; minimal go.mod) invoked via machineExecutor. Configure stdlib log/slog JSON handler on os.Stderr honoring DEVSY_LOG_LEVEL and DEVSY_LOG_FORMAT=json (#1845).
4. Runtime SDK & External Plugin Providers (2) devsy-runtime-sdk, devsy-provider-microsandbox hashicorp/go-plugin + go-hclog (Stderr streamed to host). Add stdlib slog helper in devsy-runtime-sdk/log, adopt it in devsy-provider-microsandbox, and route plugin Stderr through JSONLogStreamer (#1845).
5. Legacy Logging Repo (1) devsy-org/log Legacy April 2026 repo wrapping zap + logrus + survey. Unused by any active repo. Archive/deprecate devsy-org/log on GitHub with README notice pointing to github.com/devsy-org/devsy/pkg/log (#1843).
6. K8s / SSH Libraries Imported by devsy (5) ssh, api, apiserver, agentapi, admin-apis ssh has zero logging deps; api, apiserver, agentapi, admin-apis use k8s.io/klog/v2. Automatically covered by pkg/log/logr.go migration from zapr to logr.FromSlogHandler (#1843).
7. Out-of-Scope / Non-Provider Repos (14) platform, k8s-apiserver, charts, agents, operating-system, examples, example-dotfiles, homebrew-tap, cla-signatures, cla-assistant-action, tailscale, docs, devsy-javascript-client, test_private_repo Static assets, Helm charts, CLA actions, forks, or legacy repos. No changes required.

3. Workstream Dependency Graph

flowchart LR
    W0["#1842 W0: CLI & Desktop Flag Unification"] --> W1["#1843 W1: Core pkg/log slog Engine"]
    W1 --> W2["#1844 W2: JSONLogStreamer & Remote Agent"]
    W0 --> W4["#1846 W4: Desktop Logging & IPC"]
    W1 --> W5["#1847 W5: Unified Telemetry & Metrics"]
    W2 --> W3["#1845 W3: All 15 Provider Repos & Runtime SDK"]
    W3 --> W5
    W2 --> W6["#1848 W6: Gradual Call-Site Migration & Linter"]
Loading

4. Workstream Tracking Checklist

Activity

  1. coderabbitai commented on Nov 15, 2026

    @coderabbitai
    🔗 Related PRs

    #1828 - fix(docker): bound live output so blocked writers cannot hang docker commands [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions