diff options
author | Ben Morrison <ben@gbmor.dev> | 2019-06-06 18:26:16 -0400 |
---|---|---|
committer | Ben Morrison <ben@gbmor.dev> | 2019-06-08 02:29:28 -0400 |
commit | 78f4d8a6c1f8c41543dd5c1522ec1100a52a1283 (patch) | |
tree | e5db1bcf37e647aa8caec5902b32c6f9ea9dbff1 /svc/conf.go | |
parent | 3eb5a0321ea6e70a7ad3234efc9a0c1263833389 (diff) | |
download | getwtxt-78f4d8a6c1f8c41543dd5c1522ec1100a52a1283.tar.gz |
sqlite functionality added
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) |