mirror of
https://github.com/status-im/status-go.git
synced 2025-01-09 06:12:55 +00:00
e0eb737c51
* fix(TestProfilingCPU)_: enable run with -count=2 * fix(TestProfilingMem)_: enable run with -count=2 * fix(zaputil)_: register encoder only once * fix(timesource)_: global variables override in tests * fix(TestClosingsqlDB)_: delete database from cache * fix(postgres/helpers)_: drop connections before dropping database * fix_: linter * chore_: remove redundant condition
25 lines
504 B
Go
25 lines
504 B
Go
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 {
|
|
return MustCreateTestLoggerWithConfig(loggerConfig())
|
|
}
|
|
|
|
func MustCreateTestLoggerWithConfig(cfg zap.Config) *zap.Logger {
|
|
if err := zaputil.RegisterConsoleHexEncoder(); err != nil {
|
|
panic(err)
|
|
}
|
|
cfg.Encoding = "console-hex"
|
|
l, err := cfg.Build()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return l
|
|
}
|