only set if non-nil, avoid crash on unconfigured logger
This commit is contained in:
parent
80387fe66e
commit
7563975eef
|
@ -87,7 +87,9 @@ func ConfigureLogger(clog *log.Logger) error {
|
|||
if logReportCaller {
|
||||
clog.SetReportCaller(true)
|
||||
}
|
||||
clog.SetFormatter(logFormatter)
|
||||
if logFormatter != nil {
|
||||
clog.SetFormatter(logFormatter)
|
||||
}
|
||||
clog.SetLevel(logLevel)
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue