Closed dennwc closed 5 months ago
Latest commit: ad386dad48af26fa88b98a0c48d89eabf2b932cd
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
This change allows to take an existing
Logger
and convert it intoslog.Handler
.The reason behind this is that eventually Go ecosystem will likely converge on
slog
as a default logging interface. For examplepion/logging
could provide a wrapper for it, instead of us defining our own (logger/pionlogger
). Same for SIP library that we use.The new
ToSlogHandler
function will check if theLogger
implementation is a known one (Zap or Logr) and will convert it with package-specific functions. Both loggers that we use support slog natively now.This change doesn't affect how our logger is configured or used. We will still configure it the old way and then it could be converted to slog when needed.