Skip to content

Improve logging in configure_vscode_for_bazel.py#96

Merged
hofbi merged 2 commits into
masterfrom
ccb-logging
Apr 24, 2025
Merged

Improve logging in configure_vscode_for_bazel.py#96
hofbi merged 2 commits into
masterfrom
ccb-logging

Conversation

@lukasoyen
Copy link
Copy Markdown
Contributor

No description provided.

@lukasoyen lukasoyen requested review from Copilot and hofbi and removed request for hofbi April 24, 2025 08:02
Copy link
Copy Markdown

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.

Pull Request Overview

This PR aims to improve logging and command execution handling in the Bazel configuration helper for VS Code.

  • Introduces a new helper function run_bazel_command to centralize Bazel command execution and logging.
  • Refactors calls in query_bazel_for_labels, get_workspace_root, and adjusts the log message format in print_build_reminder.
Comments suppressed due to low confidence (1)

dev_tools/configure_vscode_for_bazel.py:161

  • [nitpick] The updated log message in print_build_reminder introduces a newline and removes command backticks, which may affect readability; verify that this format displays as intended in all environments.
logging.info("Remember to build the target(s) beforehand with%s\n\nbazel build --config=debug %s", infix, bazel_patterns[0])

cmd = ["bazel", "query", f"'{pattern}'", "--output=label_kind"]
logging.info("Running command: %s", " ".join(cmd))
return subprocess.check_output(cmd).decode(sys.stdout.encoding)
return run_bazel_command("query", f"'{pattern}'", "--output=label_kind")
Copy link

Copilot AI Apr 24, 2025

Choose a reason for hiding this comment

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

[nitpick] The logging level for the bazel query command has changed from info to debug due to the use of run_bazel_command; consider whether this might reduce user feedback if debug logging is not enabled.

Copilot uses AI. Check for mistakes.
@hofbi hofbi merged commit 7cf974b into master Apr 24, 2025
7 checks passed
@hofbi hofbi deleted the ccb-logging branch April 24, 2025 08:05
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