Improve logging in configure_vscode_for_bazel.py#96
Merged
Conversation
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
[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.
hofbi
approved these changes
Apr 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.