Split NewLogger into two so we can use a custom logrus instance.

This commit is contained in:
Caleb Brown 2022-04-13 11:18:53 +10:00 committed by Naveen
parent 91202855fd
commit b00b31646a

View File

@ -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
}