diff options
Diffstat (limited to 'svc/conf.go')
-rw-r--r-- | svc/conf.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/svc/conf.go b/svc/conf.go index 24ff305..0aaee14 100644 --- a/svc/conf.go +++ b/svc/conf.go @@ -58,9 +58,7 @@ func initLogging() { } else { logfile, err := os.OpenFile(confObj.LogFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600) - if err != nil { - log.Printf("Could not open log file: %v\n", err.Error()) - } + errLog("Could not open log file: ", err) // Listen for the signal to close the log file // in a separate thread. Passing it as an argument @@ -69,12 +67,10 @@ func initLogging() { go func(logfile *os.File) { <-closeLog + log.Printf("Closing log file ...\n") + errLog("Could not close log file: ", logfile.Close()) - err = logfile.Close() - if err != nil { - log.Printf("Couldn't close log file: %v\n", err.Error()) - } }(logfile) log.SetOutput(logfile) |