livekit / protocol

LiveKit protocol. Protobuf definitions for LiveKit's signaling protocol
https://docs.livekit.io
Apache License 2.0
71 stars 61 forks source link

Support for converting Logger into slog.Handler #668

Closed dennwc closed 5 months ago

dennwc commented 5 months ago

This change allows to take an existing Logger and convert it into slog.Handler.

The reason behind this is that eventually Go ecosystem will likely converge on slog as a default logging interface. For example pion/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 the Logger 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.

changeset-bot[bot] commented 5 months ago

🦋 Changeset detected

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

💥 An error occurred when fetching the changed packages and changesets in this PR ``` Some errors occurred when validating the changesets config: The package or glob expression "github.com/livekit/protocol" specified in the `fixed` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch. ```