mirror of
https://github.com/ossf/scorecard.git
synced 2024-09-11 00:45:36 +03:00
Split NewLogger into two so we can use a custom logrus instance.
This commit is contained in:
parent
91202855fd
commit
b00b31646a
@ -38,11 +38,16 @@ func NewLogger(logLevel Level) *Logger {
|
|||||||
logrusLevel := parseLogrusLevel(logLevel)
|
logrusLevel := parseLogrusLevel(logLevel)
|
||||||
logrusLog.SetLevel(logrusLevel)
|
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)
|
logrLogger := logrusr.New(logrusLog)
|
||||||
logger := &Logger{
|
logger := &Logger{
|
||||||
&logrLogger,
|
&logrLogger,
|
||||||
}
|
}
|
||||||
|
|
||||||
return logger
|
return logger
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user