mirror of
https://github.com/spf13/viper
synced 2025-05-11 22:57:21 +00:00
move logger out of experimental
This commit is contained in:
parent
4322cf20e9
commit
c02f8ef627
2 changed files with 7 additions and 11 deletions
|
@ -1,11 +0,0 @@
|
||||||
//go:build viper_logger
|
|
||||||
// +build viper_logger
|
|
||||||
|
|
||||||
package viper
|
|
||||||
|
|
||||||
// WithLogger sets a custom logger.
|
|
||||||
func WithLogger(l Logger) Option {
|
|
||||||
return optionFunc(func(v *Viper) {
|
|
||||||
v.logger = l
|
|
||||||
})
|
|
||||||
}
|
|
7
viper.go
7
viper.go
|
@ -281,6 +281,13 @@ func EnvKeyReplacer(r StringReplacer) Option {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WithLogger sets a custom logger.
|
||||||
|
func WithLogger(l Logger) Option {
|
||||||
|
return optionFunc(func(v *Viper) {
|
||||||
|
v.logger = l
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// NewWithOptions creates a new Viper instance.
|
// NewWithOptions creates a new Viper instance.
|
||||||
func NewWithOptions(opts ...Option) *Viper {
|
func NewWithOptions(opts ...Option) *Viper {
|
||||||
v := New()
|
v := New()
|
||||||
|
|
Loading…
Add table
Reference in a new issue