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

Replace debug with log-level flag #440

Merged
merged 9 commits into from
Oct 16, 2021

Conversation

jolheiser
Copy link
Member

@jolheiser jolheiser commented Oct 13, 2021

Adds log level support

Signed-off-by: jolheiser <john.olheiser@gmail.com>

# Conflicts:
#	server/router/router.go
@anbraten anbraten added the feature add new functionality label Oct 13, 2021
@anbraten anbraten added this to the 0.15.0 milestone Oct 13, 2021
@anbraten anbraten added the refactor delete or replace old code label Oct 13, 2021
cmd/server/server.go Outdated Show resolved Hide resolved
cmd/server/server.go Show resolved Hide resolved
cmd/agent/agent.go Outdated Show resolved Hide resolved
cmd/agent/agent.go Show resolved Hide resolved
server/router/router.go Outdated Show resolved Hide resolved
@anbraten anbraten added breaking will break existing installations if no manual action happens and removed feature add new functionality labels Oct 13, 2021
@anbraten anbraten changed the title Add logging level to CLI and API Replace debug with log-level flag Oct 13, 2021
Co-authored-by: Anbraten <anton@ju60.de>
cmd/agent/agent.go Outdated Show resolved Hide resolved
cmd/server/server.go Outdated Show resolved Hide resolved
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Signed-off-by: jolheiser <john.olheiser@gmail.com>
@jolheiser
Copy link
Member Author

Alright, I've removed the API endpoints and will add them in another PR.
I've also changed the flags a bit to go in order.

The debug flag is different between agent/server, it's a boolt (bool flag defaulting to true) in the agent, but just a normal bool flag in the server.

The logging level starts out as warn (the previous default), moves to debug if the debug flag is true (and sends a deprecation warning if the flag was actually set), and finally passes through the new log-level flag, setting the global log level after those steps are complete.

@6543
Copy link
Member

6543 commented Oct 16, 2021

@jolheiser are you ok with last commit?

@jolheiser
Copy link
Member Author

Yeah, fine with me. I wanted to limit the call site, but this is probably clearer. 🙂

@jolheiser jolheiser merged commit 03bb0e6 into woodpecker-ci:master Oct 16, 2021
@jolheiser jolheiser deleted the log-level branch October 16, 2021 22:41
@6543 6543 mentioned this pull request Oct 26, 2021
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking will break existing installations if no manual action happens refactor delete or replace old code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants