-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3c241c
commit 533941d
Showing
8 changed files
with
119 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.