forked from forbole/juno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logger.go
32 lines (26 loc) · 936 Bytes
/
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
package logging
import (
sdk "github.com/cosmos/cosmos-sdk/types"
tmctypes "github.com/tendermint/tendermint/rpc/coretypes"
"github.com/emrahm/juno/v5/modules"
"github.com/emrahm/juno/v5/types"
)
const (
LogKeyModule = "module"
LogKeyHeight = "height"
LogKeyTxHash = "tx_hash"
LogKeyMsgType = "msg_type"
)
// Logger defines a function that takes an error and logs it.
type Logger interface {
SetLogLevel(level string) error
SetLogFormat(format string) error
Info(msg string, keyvals ...interface{})
Debug(msg string, keyvals ...interface{})
Error(msg string, keyvals ...interface{})
GenesisError(module modules.Module, err error)
BlockError(module modules.Module, block *tmctypes.ResultBlock, err error)
EventsError(module modules.Module, results *tmctypes.ResultBlock, err error)
TxError(module modules.Module, tx *types.Tx, err error)
MsgError(module modules.Module, tx *types.Tx, msg sdk.Msg, err error)
}