Skip to content

refactor: [@W-18748527@] make logging uniform from language servers through parser #87

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

Merged
merged 28 commits into from
Jul 3, 2025

Conversation

peternhale
Copy link
Contributor

@peternhale peternhale commented Jul 1, 2025

Summary

This PR implements a comprehensive logging refactor across the Apex Language Support ecosystem, replacing generic logger.log() calls with semantic level-specific logging methods (logger.info(), logger.debug(), etc.) and improving the overall logging architecture.

Key Changes

Logging Architecture Refactor

  • Replaced generic logging: Converted logger.log() calls to semantic level-specific methods (info, debug, warn, error)
  • Enhanced logger factories: Added BrowserLoggerFactory and LSPLoggerFactory for better platform-specific logging
  • Improved message alignment: Better aligned log messages with their intended purpose and severity level

Package Updates

  • apex-ls-browser: Added BrowserLoggerFactory and updated notification handlers
  • apex-ls-node: Replaced ActiveLoggerFactory with LSPLoggerFactory, updated storage and notification handlers
  • apex-lsp-logging: Enhanced core logging functionality with improved examples and documentation
  • apex-lsp-vscode-extension: Updated extension configuration and logging integration
  • apex-parser-ast: Refactored parser components to use semantic logging levels
  • lsp-compliant-services: Major refactor with new handler factory pattern and improved service architecture

Architecture Improvements

  • Handler Factory Pattern: Introduced HandlerFactory for better dependency injection and testability
  • Service Layer Enhancement: Added dedicated processing services for document operations
  • Interface Standardization: Created IDocumentProcessor interface for consistent document handling
  • Configuration Management: Improved settings management across LSP services

Testing Updates

  • Updated test suites across all packages to reflect new logging patterns
  • Enhanced test coverage for new factory patterns and service layers
  • Improved test utilities and mocking strategies

Impact

  • Improved debugging capabilities through semantic logging levels
  • Better separation of concerns with dedicated service layers
  • Enhanced maintainability through standardized interfaces and factory patterns

Breaking Changes

  • Some internal interfaces have been refactored for better architecture

This refactor significantly improves the logging experience and overall code architecture while maintaining backward compatibility where possible.

@W-18748527@

@peternhale peternhale requested a review from a team as a code owner July 1, 2025 16:23
@peternhale peternhale requested a review from mshanemc July 1, 2025 16:23
@peternhale peternhale changed the title refactor: make logging uniform from language servers through parser refactor: [@W-18748527@] make logging uniform from language servers through parser Jul 1, 2025
@peternhale peternhale requested a review from kylewalke July 1, 2025 16:24
@peternhale peternhale marked this pull request as draft July 1, 2025 20:06
@peternhale peternhale marked this pull request as ready for review July 3, 2025 13:02
kylewalke
kylewalke previously approved these changes Jul 3, 2025
Copy link
Contributor

@mshanemc mshanemc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved without QA because the whole pkg is not shipped, it's just logger stuff, and we'll have a4d testing soon

@peternhale peternhale merged commit aeb31a2 into main Jul 3, 2025
11 checks passed
@peternhale peternhale deleted the phale/log-message-refactor branch July 3, 2025 18:06
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.

3 participants