From 78f4d8a6c1f8c41543dd5c1522ec1100a52a1283 Mon Sep 17 00:00:00 2001 From: Ben Morrison Date: Thu, 6 Jun 2019 18:26:16 -0400 Subject: sqlite functionality added --- svc/conf.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'svc/conf.go') 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) -- cgit 1.4.1-2-gfad0