-
Notifications
You must be signed in to change notification settings - Fork 0
/
logger.go
37 lines (29 loc) · 878 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
33
34
35
36
37
// This package is a hack. It is meant to solve temporary logging pains in simulation.
// Every issue this package fixes needs a longer term fix in our stack, to not get into full node logs.
package simlogger
import (
"strings"
"github.com/tendermint/tendermint/libs/log"
)
type simLogger struct {
logger log.Logger
}
func (s *simLogger) Debug(msg string, keyvals ...interface{}) {
// Suppress this log
if strings.Contains(msg, "committed KVStore") {
return
}
s.logger.Debug(msg, keyvals...)
}
func (s *simLogger) Info(msg string, keyvals ...interface{}) {
s.logger.Info(msg, keyvals)
}
func (s *simLogger) Error(msg string, keyvals ...interface{}) {
s.logger.Error(msg, keyvals)
}
func (s *simLogger) With(keyvals ...interface{}) log.Logger {
return s.logger.With(keyvals...)
}
func NewSimLogger(logger log.Logger) log.Logger {
return &simLogger{logger}
}