Skip to content

Add centralized error reporting and output channel logging #16

Description

@dollfins

Description

The extension has no error reporting or telemetry. When the CLI fails, diagnostics fail, or unexpected errors occur, there is no way to understand what went wrong without asking the user to check the developer console.

Current State

  • Errors are logged to console.error (invisible to most users)
  • The output channel (client.ts) is only used for binary checks
  • No crash reporting
  • No usage analytics

Expected Behavior

Error Reporting

  • Route all errors through a centralized error handler that:
    1. Logs to the output channel with timestamps
    2. Shows user-friendly notifications for actionable errors
    3. Optionally sends anonymized error reports (opt-in)

Output Channel Improvements

  • Use client.ts for all diagnostic-related logging
  • Log each scan start/end/duration
  • Log CLI invocation commands (without arguments that might contain sensitive paths)
  • Add log level filtering (error/warn/info/debug)

Telemetry (Optional)

  • Integrate with VS Code's TelemetryLogger API for basic usage stats
  • Track: scan count, findings per scan, common rule IDs triggered
  • Make telemetry opt-in through VS Code's global telemetry setting

Implementation Notes

  • VS Code 1.69+ provides TelemetryLogger via vscode.env — use this if available
  • The output channel class in client.ts should be the single logging entry point
  • Add a sorobanGuard.logLevel setting to control verbosity
  • Do NOT log file contents or project names in telemetry

Acceptance Criteria

  • All errors are logged to the Soroban Guard output channel
  • User-facing notifications for CLI not found or scan failures
  • Scan start/end/duration is logged
  • Log level setting controls verbosity
  • Telemetry (if implemented) respects VS Code's telemetry setting
  • No sensitive data is logged or transmitted

Complexity

Medium — requires centralized error handling, output channel integration, and optional telemetry API usage.

Points

150

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions