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

Add log level API #444

Merged
merged 4 commits into from
Oct 18, 2021
Merged

Add log level API #444

merged 4 commits into from
Oct 18, 2021

Conversation

jolheiser
Copy link
Member

A couple things to note:

  • I added zerolog to the CLI so parsing (and possible error handling) can happen in the CLI instead of wasting the roundtrip to the server
    • Since the dep was added, I opted to change the output to use zerolog as well, let me know if you want it changed back
  • I don't love the CLI implementation, willing to gather feedback. Particularly setting level with a flag, but I also didn't particularly like the alternative of checking for first arg either

It's a little awkward to think about log level because it can get conflated with "build logs" rather than "application logging".

Signed-off-by: jolheiser <john.olheiser@gmail.com>
@jolheiser jolheiser added enhancement improve existing features cli labels Oct 13, 2021
@jolheiser jolheiser added this to the 0.15.0 milestone Oct 13, 2021
Copy link
Member

@anbraten anbraten left a comment

Choose a reason for hiding this comment

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

Nice work. Really like that it can be directly changed via cli as well. 👍🏾

Since the dep was added, I opted to change the output to use zerolog as well, let me know if you want it changed back

So we would switch to use zerolog for logging in the cli in a separate PR?

It's a little awkward to think about log level because it can get conflated with "build logs" rather than "application logging".

You already added some usage hints, so I think that's okay.

server/router/router.go Outdated Show resolved Hide resolved
cli/loglevel/loglevel.go Outdated Show resolved Hide resolved
cli/loglevel/loglevel.go Outdated Show resolved Hide resolved
jolheiser and others added 2 commits October 17, 2021 11:59
Co-authored-by: Anbraten <anton@ju60.de>
Signed-off-by: jolheiser <john.olheiser@gmail.com>
@jolheiser
Copy link
Member Author

  1. Moved the route to /api/log-level.
  2. Fixed error handling in the CLI.
  3. Changed the CLI so that no args gets the log level, otherwise first arg sets the log level.

@jolheiser jolheiser merged commit 8e658c1 into woodpecker-ci:master Oct 18, 2021
@jolheiser jolheiser deleted the log-level-api branch October 18, 2021 23:25
@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
cli enhancement improve existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants