Skip to content

Add debug logging#120

Merged
robmck1995 merged 2 commits intomainfrom
add_logging
Jan 30, 2025
Merged

Add debug logging#120
robmck1995 merged 2 commits intomainfrom
add_logging

Conversation

@robmck1995
Copy link
Copy Markdown
Contributor

@robmck1995 robmck1995 commented Jan 30, 2025

CodeAnt-AI Description

  • Added debug logging for the Ruby LSP process by redirecting stderr to a log file.
  • Fixed a typo in the Ruby root files list in workspace_documents.rs.
  • Updated the LSPROXY version from 0.3.4 to 0.3.5 in both the install script and Cargo.toml.

Changes walkthrough

Relevant files
Enhancement
ruby.rs
Add debug logging for Ruby LSP process                                                 

lsproxy/src/lsp/languages/ruby.rs

  • Added debug logging by creating a log file for stderr.
  • Redirected stderr to a debug file for the Ruby LSP process.
  • +2/-1     
    Bug fix
    workspace_documents.rs
    Fix typo in Ruby root files list                                                             

    lsproxy/src/utils/workspace_documents.rs

    • Corrected a typo in the Ruby root files list.
    +1/-1     
    Other
    install-lsproxy.sh
    Bump LSPROXY version in install script                                                 

    release/install-lsproxy.sh

    • Updated the LSPROXY version from 0.3.4 to 0.3.5.
    +1/-1     
    Cargo.toml
    Update package version in Cargo.toml                                                     

    lsproxy/Cargo.toml

    • Updated the package version from 0.3.4 to 0.3.5.
    +1/-1     
    💡 Usage Guide

    Checking Your Pull Request

    Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

    Talking to CodeAnt AI

    Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

    @codeant-ai ask: Your question here
    

    This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

    Retrigger review

    Ask CodeAnt AI to review the PR again, by typing:

    @codeant-ai: review
    

    Check Your Repository Health

    To analyze the health of your code repository, visit our dashboard at app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

    @robmck1995 robmck1995 merged commit 587c130 into main Jan 30, 2025
    @codeant-ai codeant-ai Bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Jan 30, 2025
    @codeant-ai
    Copy link
    Copy Markdown
    Contributor

    codeant-ai Bot commented Jan 30, 2025

    Pull Request Feedback 🔍

    🔒 No security issues identified
    ⚡ Recommended areas for review

    File Path Hardcoding
    The debug log file path is hardcoded to "/tmp/ruby-lsp.log". Consider making this configurable to allow flexibility in different environments.

    root_path: &str,
    watch_events_rx: Receiver<DebouncedEvent>,
    ) -> Result<Self, Box<dyn std::error::Error + Send + Sync>> {
    let debug_file = std::fs::File::create("/tmp/ruby-lsp.log")?;
    Copy link
    Copy Markdown
    Contributor

    Choose a reason for hiding this comment

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

    Suggestion: Handle potential errors when creating the log file to ensure the application can respond appropriately if the file cannot be created. [possible issue]

    Suggested change
    let debug_file = std::fs::File::create("/tmp/ruby-lsp.log")?;
    let debug_file = std::fs::File::create("/tmp/ruby-lsp.log").map_err(|e| {
    eprintln!("Failed to create log file: {}", e);
    e
    })?;

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

    Labels

    size:XS This PR changes 0-9 lines, ignoring generated files

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants