Skip to content
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

Rust: fix qltest logging #18882

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Rust: fix qltest logging #18882

wants to merge 3 commits into from

Conversation

redsun82
Copy link
Contributor

Also added a new logging_color option to disable coloring (which does not look very good in files).

Also added a new `logging_color` option to disable coloring (which does
not look very good in files).
@Copilot Copilot bot review requested due to automatic review settings February 27, 2025 11:42
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR addresses issues in the qltest logging by updating the extractor’s logging options and adding a new logging_color option so that colored output can be disabled when writing to files. Key changes include:

  • Adding a new color option to the CodeQL extractor configuration file.
  • Updating Cargo.toml to add the is-terminal dependency.
  • Adjusting logging setup in main.rs and introducing a new Color enum (with corresponding functionality) in config.rs and shared/tree-sitter-extractor.

Reviewed Changes

File Description
rust/codeql-extractor.yml Added a new color option with a pattern restricting values to "yes" or "no".
rust/extractor/Cargo.toml Added a dependency on is-terminal.
rust/extractor/src/main.rs Updated logging subscriber initialization to use the logging_color option.
rust/extractor/src/config.rs Introduced a new Color enum with a yes() helper method and integrated it into Config.
shared/tree-sitter-extractor/src/extractor/mod.rs Added a Color enum with a from(bool) method and updated the default_subscriber_with_level accordingly.

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

rust/extractor/src/config.rs:37

  • [nitpick] Consider implementing a From for Color to align its API with the Color enum defined in shared/tree-sitter-extractor, which may simplify conversions and improve consistency across modules.
pub enum Color {

Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Feb 27, 2025
@redsun82 redsun82 requested a review from a team as a code owner February 27, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant