mirror of
https://github.com/spf13/viper
synced 2024-12-22 03:27:03 +00:00
refactor!: drop unused Logger interface
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
This commit is contained in:
parent
7f90580059
commit
7162e9244e
1 changed files with 0 additions and 36 deletions
36
logger.go
36
logger.go
|
@ -5,42 +5,6 @@ import (
|
||||||
"log/slog"
|
"log/slog"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Logger is a unified interface for various logging use cases and practices, including:
|
|
||||||
// - leveled logging
|
|
||||||
// - structured logging
|
|
||||||
//
|
|
||||||
// Deprecated: use `log/slog` instead.
|
|
||||||
type Logger interface {
|
|
||||||
// Trace logs a Trace event.
|
|
||||||
//
|
|
||||||
// Even more fine-grained information than Debug events.
|
|
||||||
// Loggers not supporting this level should fall back to Debug.
|
|
||||||
Trace(msg string, keyvals ...any)
|
|
||||||
|
|
||||||
// Debug logs a Debug event.
|
|
||||||
//
|
|
||||||
// A verbose series of information events.
|
|
||||||
// They are useful when debugging the system.
|
|
||||||
Debug(msg string, keyvals ...any)
|
|
||||||
|
|
||||||
// Info logs an Info event.
|
|
||||||
//
|
|
||||||
// General information about what's happening inside the system.
|
|
||||||
Info(msg string, keyvals ...any)
|
|
||||||
|
|
||||||
// Warn logs a Warn(ing) event.
|
|
||||||
//
|
|
||||||
// Non-critical events that should be looked at.
|
|
||||||
Warn(msg string, keyvals ...any)
|
|
||||||
|
|
||||||
// Error logs an Error event.
|
|
||||||
//
|
|
||||||
// Critical events that require immediate attention.
|
|
||||||
// Loggers commonly provide Fatal and Panic levels above Error level,
|
|
||||||
// but exiting and panicking is out of scope for a logging library.
|
|
||||||
Error(msg string, keyvals ...any)
|
|
||||||
}
|
|
||||||
|
|
||||||
// WithLogger sets a custom logger.
|
// WithLogger sets a custom logger.
|
||||||
func WithLogger(l *slog.Logger) Option {
|
func WithLogger(l *slog.Logger) Option {
|
||||||
return optionFunc(func(v *Viper) {
|
return optionFunc(func(v *Viper) {
|
||||||
|
|
Loading…
Reference in a new issue