Skip to content

Commit

Permalink
Split NewLogger into two so we can use a custom logrus instance.
Browse files Browse the repository at this point in the history
  • Loading branch information
calebbrown authored and naveensrinivasan committed Apr 13, 2022
1 parent 9120285 commit b00b316
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,16 @@ func NewLogger(logLevel Level) *Logger {
logrusLevel := parseLogrusLevel(logLevel)
logrusLog.SetLevel(logrusLevel)

return NewLogrusLogger(logrusLog)
}

// NewLogrusLogger creates an instance of *Logger backed by the supplied
// logrusLog instance.
func NewLogrusLogger(logrusLog *logrus.Logger) *Logger {
logrLogger := logrusr.New(logrusLog)
logger := &Logger{
&logrLogger,
}

return logger
}

Expand Down

0 comments on commit b00b316

Please sign in to comment.