Open dmke opened 10 months ago
Attention: Patch coverage is 47.03390%
with 125 lines
in your changes missing coverage. Please review.
Please upload report for BASE (
master@7e9eb47
). Learn more about missing BASE report.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This replaces the zap logging engine with Go 1.21's new structured logger,
log/slog
, or more precisely a thin wrapper around that (xlog
).The log/slog package has a few things missing, which are present in
xlog
:xlog
provides a no-op logger, which simply discards any log output. This is extensively used in our tests.xlog
has aFatal()
output method, which simply callsError()
and thenos.Exit(1)
.xlog
does not provide global convenience functions to access a default logger instance; all calls must go through aLogger
instance created withNew()
.xlog
treats error values as first-class citizen. Since(log/slog).Error()
is a convenience function for their default logger instance, there is no built-in way to treat errors as values. In comparison,(xlog).Error(err)
constructs anslog.Attr
.Point (2) is debatable, since
xlog.Fatal
is only used incmd/texd/main.go
, so I'd be willing to forfeit it.Some TODOs remain:
xlog
, i.e. its extension over log/slog, is not really testedxlog.New()
Issue: #1