Skip to content

Commit

Permalink
Add ns time precision to log output.
Browse files Browse the repository at this point in the history
  • Loading branch information
brocaar committed Apr 6, 2021
1 parent 604d5e8 commit 1a7ed28
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/chirpstack-network-server/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package main

import (
"time"

log "github.com/sirupsen/logrus"
"google.golang.org/grpc/grpclog"

Expand Down Expand Up @@ -49,6 +51,10 @@ func (gl *grpcLogger) Infof(format string, args ...interface{}) {
}

func init() {
log.SetFormatter(&log.TextFormatter{
TimestampFormat: time.RFC3339Nano,
})

grpclog.SetLoggerV2(&grpcLogger{log.StandardLogger()})
}

Expand Down

0 comments on commit 1a7ed28

Please sign in to comment.