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

Log levels #1635

Merged
merged 5 commits into from
May 18, 2022
Merged

Log levels #1635

merged 5 commits into from
May 18, 2022

Conversation

moskyb
Copy link
Contributor

@moskyb moskyb commented May 12, 2022

🤔 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 envar BUILDKITE_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, except bootstrap.

This PR is best read commit-by-commit.

@moskyb moskyb requested review from pda and tessereth May 12, 2022 22:53
clicommand/global.go Outdated Show resolved Hide resolved
Copy link
Member

@sj26 sj26 left a 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.

@moskyb moskyb force-pushed the log-levels branch 2 times, most recently from f140411 to 5695227 Compare May 15, 2022 22:55
Copy link
Contributor

@tessereth tessereth left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

None yet

3 participants