Log to STDOUT if running as HTTP service
This commit is contained in:
parent
c70083958f
commit
ffbb182678
|
@ -60,6 +60,9 @@ func Log(msg string) {
|
|||
if !*isDebug {
|
||||
return
|
||||
}
|
||||
if *IsHTTPServer {
|
||||
fmt.Println(msg)
|
||||
} else {
|
||||
f, oErr := os.OpenFile(logfile, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0600)
|
||||
if oErr != nil {
|
||||
Shutdown(oErr)
|
||||
|
@ -70,6 +73,7 @@ func Log(msg string) {
|
|||
if _, wErr := f.WriteString(msg); wErr != nil {
|
||||
Shutdown(wErr)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func initialise() {
|
||||
|
|
Loading…
Reference in a new issue