-
Notifications
You must be signed in to change notification settings - Fork 289
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
Log levels #1635
Log levels #1635
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good to me! The env name doesn't fit the pattern of the rest, is that intentional?
I'll let one of our more dedicated gophers do a pass for approval.
f140411
to
5695227
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This required rejigging the config loading a little bit, but this is now done in line with the way that buildkite-agent start does it
🤔 Problem: Some of the time, users of the buildkite-agent might not necessarily want or need all of the logs we're spitting out, either for cost reasons (storing logs can get pricy) or for readability reasons (i don't necessarily care about everything the agent is doing all the time.
✅ Solution: Add a cli flag,
--log-level
and an accompanying envarBUILDKITE_AGENT_LOG_LEVEL
, to set the level of the logger on the agent. Now, if I set--log-level error
, the buildkite agent logger will only output logs of level error or higher. This flag is enabled for all CLI commands, exceptbootstrap
.This PR is best read commit-by-commit.