fix: only enable debug logs GH action is debugged#118
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR modifies the GitHub Actions logger to only enable debug logs when GitHub Actions debugging is explicitly enabled, improving performance by avoiding unnecessary debug log processing.
- Adds dynamic log level detection based on GitHub Actions environment variables
- Refactors
GithubActionLoggerfrom a unit struct to a struct with configurable log level - Updates logger instantiation to use the new constructor
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/run/run_environment/github_actions/provider.rs |
Updates logger instantiation to use new constructor |
src/run/run_environment/github_actions/logger.rs |
Implements dynamic log level configuration based on environment variables |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
66a856b to
171e73e
Compare
| impl GithubActionLogger { | ||
| pub fn new() -> Self { | ||
| // Only enable debug logging if it's enabled in GitHub Actions. | ||
| let log_level = if env::var("RUNNER_DEBUG").unwrap_or_default() == "1" { |
There was a problem hiding this comment.
Do you have docs on this RUNNER_DEBUG flag?
There was a problem hiding this comment.
It's mentioned in the docs here: https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#runner-context, i'll add a link in the code
There was a problem hiding this comment.
Ah thanks. Actually this page is about the env variables: https://docs.github.com/en/actions/reference/workflows-and-actions/variables
171e73e to
06a03e0
Compare
06a03e0 to
682663e
Compare
682663e to
f7f23f0
Compare
No description provided.