mirror of
https://github.com/outbackdingo/ghorg.git
synced 2026-01-27 18:18:58 +00:00
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.19.0 to 1.20.1. - [Release notes](https://github.com/spf13/viper/releases) - [Commits](https://github.com/spf13/viper/compare/v1.19.0...v1.20.1) --- 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> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: gabrie30 <gabrie30@users.noreply.github.com>
32 lines
544 B
Go
32 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
|
|
}
|