2019-11-21 16:19:22 +00:00
|
|
|
package tt
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/status-im/status-go/protocol/zaputil"
|
|
|
|
|
|
|
|
"go.uber.org/zap"
|
|
|
|
)
|
|
|
|
|
|
|
|
// MustCreateTestLogger returns a logger based on the passed flags.
|
|
|
|
func MustCreateTestLogger() *zap.Logger {
|
2024-02-26 14:51:37 +00:00
|
|
|
return MustCreateTestLoggerWithConfig(loggerConfig())
|
2023-12-15 19:50:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func MustCreateTestLoggerWithConfig(cfg zap.Config) *zap.Logger {
|
2024-08-23 19:30:58 +00:00
|
|
|
if err := zaputil.RegisterConsoleHexEncoder(); err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
2019-11-21 16:19:22 +00:00
|
|
|
cfg.Encoding = "console-hex"
|
|
|
|
l, err := cfg.Build()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return l
|
|
|
|
}
|