mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-06 10:29:31 -06:00
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.19.0 to 1.20.0. - [Release notes](https://github.com/spf13/viper/releases) - [Commits](https://github.com/spf13/viper/compare/v1.19.0...v1.20.0) --- updated-dependencies: - dependency-name: github.com/spf13/viper dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
31 lines
544 B
Go
31 lines
544 B
Go
package viper
|
|
|
|
import (
|
|
"context"
|
|
"log/slog"
|
|
)
|
|
|
|
// WithLogger sets a custom logger.
|
|
func WithLogger(l *slog.Logger) Option {
|
|
return optionFunc(func(v *Viper) {
|
|
v.logger = l
|
|
})
|
|
}
|
|
|
|
type discardHandler struct{}
|
|
|
|
func (n *discardHandler) Enabled(_ context.Context, _ slog.Level) bool {
|
|
return false
|
|
}
|
|
|
|
func (n *discardHandler) Handle(_ context.Context, _ slog.Record) error {
|
|
return nil
|
|
}
|
|
|
|
func (n *discardHandler) WithAttrs(_ []slog.Attr) slog.Handler {
|
|
return n
|
|
}
|
|
|
|
func (n *discardHandler) WithGroup(_ string) slog.Handler {
|
|
return n
|
|
}
|