only set if non-nil, avoid crash on unconfigured logger
This commit is contained in:
parent
0529a256bb
commit
890da37793
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue