summary refs log tree commit diff stats
path: root/svc/conf.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-06-06 18:26:16 -0400
committerBen Morrison <ben@gbmor.dev>2019-06-08 02:29:28 -0400
commit78f4d8a6c1f8c41543dd5c1522ec1100a52a1283 (patch)
treee5db1bcf37e647aa8caec5902b32c6f9ea9dbff1 /svc/conf.go
parent3eb5a0321ea6e70a7ad3234efc9a0c1263833389 (diff)
downloadgetwtxt-78f4d8a6c1f8c41543dd5c1522ec1100a52a1283.tar.gz
sqlite functionality added
Diffstat (limited to 'svc/conf.go')
-rw-r--r--svc/conf.go10
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)