Conversation
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
| ) | ||
|
|
||
| func main() { | ||
| log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr, TimeFormat: time.RFC3339}) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
I'm good for getting better logging. I'm enjoying structured logging in my Rust projects so I like it as well. |
This changes the logging to zerolog. What do you think @eternal-flame-AD? we could use log.* everywhere, but I kinda like zerolog more.