[log] dispaly nano sec in timestamp

Signed-off-by: Leo Chen <leo@harmony.one>
pull/1428/head
Leo Chen 5 years ago
parent 591c6fbece
commit b743dcc840
  1. 2
      internal/utils/singleton.go

@ -9,6 +9,7 @@ import (
"path" "path"
"sync" "sync"
"sync/atomic" "sync/atomic"
"time"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/natefinch/lumberjack" "github.com/natefinch/lumberjack"
@ -139,6 +140,7 @@ func setZeroLoggerFileOutput(filepath string, maxSize int) error {
// Logger returns a zerolog.Logger singleton // Logger returns a zerolog.Logger singleton
func Logger() *zerolog.Logger { func Logger() *zerolog.Logger {
if zeroLogger == nil { if zeroLogger == nil {
zerolog.TimeFieldFormat = time.RFC3339Nano
logger := zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr}). logger := zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr}).
Level(zeroLoggerLevel). Level(zeroLoggerLevel).
With(). With().

Loading…
Cancel
Save