1
0
mirror of https://github.com/taigrr/godns synced 2025-01-18 04:03:25 -08:00

use stdout as default log output.

This commit is contained in:
Timothy Ye
2018-04-17 20:42:17 +08:00
parent 2a23abbcbd
commit f428da55c8
2 changed files with 24 additions and 29 deletions

View File

@@ -40,20 +40,8 @@ func main() {
os.Exit(1)
}
if configuration.LogPath == "" {
configuration.LogPath = "./godns.log"
}
// Init log file
f, err := os.OpenFile(configuration.LogPath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
fmt.Println("Failed to create log file:", configuration.LogPath)
os.Exit(1)
}
defer f.Close()
log.SetOutput(f)
// Init log settings
log.SetPrefix("【GoDNS】")
log.Println("GoDNS started, entering main loop...")
dnsLoop()
}