Move closing the default logger after printing configuration errors

This commit is contained in:
ptrcnull 2022-04-24 03:44:23 +02:00 committed by Max Mazurov
parent 4b1c4f932a
commit c9c856ffb6

View file

@ -161,6 +161,8 @@ func Run() int {
return 2
}
defer log.DefaultLogger.Out.Close()
if err := moduleMain(cfg); err != nil {
systemdStatusErr(err)
log.Println(err)
@ -271,8 +273,6 @@ func moduleMain(cfg []config.Node) error {
return err
}
defer log.DefaultLogger.Out.Close()
hooks.AddHook(hooks.EventLogRotate, reinitLogging)
endpoints, mods, err := RegisterModules(globals, modBlocks)