diff --git a/log/logger.go b/log/logger.go index 955a2abc0..a1c0219f0 100644 --- a/log/logger.go +++ b/log/logger.go @@ -32,6 +32,9 @@ func NewNullLogger() *Logger { // New creates a new logger. func New(logger *logrus.Logger, iterID string) *Logger { + if logger == nil { + logger = logrus.New() + } return &Logger{ Logger: logger, iterID: iterID, @@ -87,10 +90,6 @@ func (l *Logger) Logf(level logrus.Level, category string, msg string, args ...a if l.categoryFilter != nil && !l.categoryFilter.MatchString(category) { return } - if l.Logger == nil { - fmt.Printf("%s [%d]: %s - %d ms\n", category, goRoutineID(), string(msg), elapsed) - return - } fields := logrus.Fields{ "category": category, "elapsed": fmt.Sprintf("%d ms", elapsed),