Skip to content

fix: use zerolog#962

Open
jmattheis wants to merge 2 commits into
masterfrom
log
Open

fix: use zerolog#962
jmattheis wants to merge 2 commits into
masterfrom
log

Conversation

@jmattheis
Copy link
Copy Markdown
Member

This changes the logging to zerolog. What do you think @eternal-flame-AD? we could use log.* everywhere, but I kinda like zerolog more.

@jmattheis jmattheis requested a review from a team as a code owner May 17, 2026 09:54
@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

❌ Patch coverage is 44.44444% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.51%. Comparing base (ec8ce07) to head (21d42cc).
⚠️ Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
runner/runner.go 0.00% 26 Missing ⚠️
app.go 0.00% 8 Missing ⚠️
router/router.go 75.00% 5 Missing and 3 partials ⚠️
api/oidc.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #962      +/-   ##
==========================================
- Coverage   75.01%   74.51%   -0.51%     
==========================================
  Files          61       61              
  Lines        2886     2927      +41     
==========================================
+ Hits         2165     2181      +16     
- Misses        566      591      +25     
  Partials      155      155              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread app.go Outdated
)

func main() {
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr, TimeFormat: time.RFC3339})
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This need to be guarded by a isTerminal check. A lot of people run Gotify with a supervisor (systemd, etc) or a pipe and will want the log clear of ANSI escape sequences.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Another thing is it doesn't look like zerolog has an environment variable for changing log levels? do we have to manually code that or?

Copy link
Copy Markdown
Member Author

@jmattheis jmattheis May 18, 2026

Choose a reason for hiding this comment

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

Yeah, I'll add the log level in a separate PR with a rework of the overall config.

I've added terminal check + NO_COLOR check. I'll probably move the NO_COLOR env var later to the config package.

I also changed it to stdout, makes more sense as we don't output to stdout anywhere else.

@eternal-flame-AD
Copy link
Copy Markdown
Member

I'm good for getting better logging. I'm enjoying structured logging in my Rust projects so I like it as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants