status-go/protocol/tt/logger.go
Pedro Pombeiro ed5a5c154d
Move to monorepo structure (#1684)
Move to a monorepo structure with submodules

- Rename status-protocol-go to status-go/protocol
2019-11-21 17:19:22 +01:00

29 lines
486 B
Go

package tt
import (
"sync"
"github.com/status-im/status-go/protocol/zaputil"
"go.uber.org/zap"
)
var registerOnce sync.Once
// MustCreateTestLogger returns a logger based on the passed flags.
func MustCreateTestLogger() *zap.Logger {
registerOnce.Do(func() {
if err := zaputil.RegisterConsoleHexEncoder(); err != nil {
panic(err)
}
})
cfg := zap.NewDevelopmentConfig()
cfg.Encoding = "console-hex"
l, err := cfg.Build()
if err != nil {
panic(err)
}
return l
}