Skip to content

Commit

Permalink
Uses a second logrus instance with WARN loglevel for GRPC.
Browse files Browse the repository at this point in the history
PR fix: Replaces string parsing for `warn` with logrus constant.
  • Loading branch information
nwaldispuehl committed Sep 11, 2023
1 parent ddd3fb8 commit 167b61a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/traces/traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ func Logger(ctx context.Context) *logrus.Entry {
// Creates a new instance of the logger which only logs WARNING events.
// We use it as logger for the GRPC events which are hardcoded as INFO level and pollute the logs.
func WarnLogger(ctx context.Context) *logrus.Entry {
warnLevel, _ := logrus.ParseLevel("warn")
warnLogger := logrus.New();
warnLogger.SetLevel(warnLevel)
warnLogger := logrus.New()
warnLogger.SetLevel(logrus.WarnLevel)
return warnLogger.WithField("trace.id", TraceID(ctx))
}

Expand Down

0 comments on commit 167b61a

Please sign in to comment.