lnd: log shutdown before closing rotator

This commit is contained in:
Conner Fromknecht 2018-09-20 03:24:53 -07:00
parent bfcda6e205
commit bbceec8bea
No known key found for this signature in database
GPG Key ID: E7D737B67FA592C7

7
lnd.go

@ -93,12 +93,6 @@ var (
// defers created in the top-level scope of a main method aren't executed if // defers created in the top-level scope of a main method aren't executed if
// os.Exit() is called. // os.Exit() is called.
func lndMain() error { func lndMain() error {
defer func() {
if logRotatorPipe != nil {
ltndLog.Info("Shutdown complete")
}
}()
// Load the configuration, and parse any command line options. This // Load the configuration, and parse any command line options. This
// function will also set up logging properly. // function will also set up logging properly.
loadedConfig, err := loadConfig() loadedConfig, err := loadConfig()
@ -108,6 +102,7 @@ func lndMain() error {
cfg = loadedConfig cfg = loadedConfig
defer func() { defer func() {
if logRotator != nil { if logRotator != nil {
ltndLog.Info("Shutdown complete")
logRotator.Close() logRotator.Close()
} }
}() }()