Skip to content

Commit

Permalink
fixup! respect our logger
Browse files Browse the repository at this point in the history
  • Loading branch information
inancgumus committed Mar 10, 2023
1 parent c5b1746 commit 7d0c6a3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions log/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ func NewNullLogger() *Logger {

// New creates a new logger.
func New(logger logrus.FieldLogger, iterID string) *Logger {
ll := logrus.New()
ll := &Logger{
Logger: logrus.New(),
iterID: iterID,
}

if logger == nil {
ll.Warn("Logger", "no logger supplied, using default")
ll.Warnf("Logger", "no logger supplied, using default")
} else if l, ok := logger.(*logrus.Logger); !ok {
ll.Warn("Logger", "invalid logger type, using default")
ll.Warnf("Logger", "invalid logger type %T, using default", logger)
} else {
ll = l
ll.Logger = l
}

return &Logger{
Logger: ll,
iterID: iterID,
}
return ll
}

// Tracef logs a trace message.
Expand Down

0 comments on commit 7d0c6a3

Please sign in to comment.