Skip to content

[WIP] Add debug logging using the new logging system #547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

jaggederest
Copy link
Contributor

Mostly an example PR for how the logging system might be used, if the logging system is merged in #545 more or less as is, I will work towards actually merging this.

jaggederest and others added 10 commits July 2, 2025 19:24
Implement a centralized logging system to improve debugging capabilities
and separate logging concerns from the Storage class.

- Add logger module with configurable debug/info levels
- Support runtime configuration via coder.verbose setting
- Provide OutputChannelAdapter for VS Code integration
- Add ArrayAdapter for isolated unit testing
- Include performance benchmarks in tests
- Maintain backward compatibility via Storage delegation
- Update all components to use centralized logger

The logger responds to configuration changes without requiring extension
restart and includes source location tracking for debug messages.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Create detailed specification for adding debug logging to connection
and reconnection logic, focusing on SSH configuration, connection
lifecycle tracking, and error capture with sensitive data masking.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add comprehensive debug logging throughout the codebase to aid in troubleshooting connection issues:

- Add process error handlers (uncaughtException, unhandledRejection)
- Add process signal handlers (SIGTERM, SIGINT, SIGHUP)
- Add memory pressure monitoring with heap usage alerts
- Implement sensitive data masking for logs (SSH keys, passwords, tokens)
- Add debug logging to SSH config operations with masked output
- Add connection lifecycle logging with unique connection IDs
- Add retry logic and backoff timing logs
- Add workspace disconnection event logging
- Refactor logger to separate vscode dependencies using adapter pattern
- Create ConfigProvider interface for test isolation
- Reorganize files into logical directories (config/, logging/, test/)
- All debug logs gated by coder.verbose flag

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
The debug logging implementation has been completed with:
- Process error and signal handlers
- Memory pressure monitoring
- SSH config logging with sensitive data masking
- Connection lifecycle tracking
- Consistent log formatting

Minor gaps remain for future enhancement:
- Explicit backoff delay values in retry logs
- Network timeout duration logging
- HTTP error codes with connection context

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant