forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use cosmossdk.io/log in v0.47 (cosmos#15984)
- Loading branch information
1 parent
9b78cf9
commit afd931a
Showing
9 changed files
with
109 additions
and
24 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
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
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,22 @@ | ||
package server | ||
|
||
import ( | ||
"cosmossdk.io/log" | ||
cmtlog "github.com/cometbft/cometbft/libs/log" | ||
) | ||
|
||
var _ cmtlog.Logger = (*CometLoggerWrapper)(nil) | ||
|
||
// CometLoggerWrapper provides a wrapper around a zerolog.Logger instance. | ||
// It implements CometBFT's Logger interface. | ||
type CometLoggerWrapper struct { | ||
log.Logger | ||
} | ||
|
||
// With returns a new wrapped logger with additional context provided by a set | ||
// of key/value tuples. The number of tuples must be even and the key of the | ||
// tuple must be a string. | ||
func (cmt CometLoggerWrapper) With(keyVals ...interface{}) cmtlog.Logger { | ||
logger := cmt.Logger.With(keyVals...) | ||
return CometLoggerWrapper{logger} | ||
} |
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
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.