forked from cosmos/iavl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logger.go
34 lines (27 loc) · 1.14 KB
/
logger.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package iavl
// Logger defines basic logger that IAVL expects.
// It is a subset of the cosmossdk.io/core/log.Logger interface.
// cosmossdk.io/log/log.Logger implements this interface.
type Logger interface {
// Info takes a message and a set of key/value pairs and logs with level INFO.
// The key of the tuple must be a string.
Info(msg string, keyVals ...any)
// Warn takes a message and a set of key/value pairs and logs with level WARN.
// The key of the tuple must be a string.
Warn(msg string, keyVals ...any)
// Error takes a message and a set of key/value pairs and logs with level ERR.
// The key of the tuple must be a string.
Error(msg string, keyVals ...any)
// Debug takes a message and a set of key/value pairs and logs with level DEBUG.
// The key of the tuple must be a string.
Debug(msg string, keyVals ...any)
}
// NewNopLogger returns a new logger that does nothing.
func NewNopLogger() Logger {
return &noopLogger{}
}
type noopLogger struct{}
func (l *noopLogger) Info(string, ...any) {}
func (l *noopLogger) Warn(string, ...any) {}
func (l *noopLogger) Error(string, ...any) {}
func (l *noopLogger) Debug(string, ...any) {}