Commit 5ddace94 authored by Jordan Sissel's avatar Jordan Sissel

- move syslog stuff to a separate file for cross-platformisms

  (log/syslog isn't a thing on go in windows)
parent f9a43286
......@@ -5,7 +5,6 @@ import (
"os"
"time"
"flag"
"log/syslog"
"runtime/pprof"
)
......@@ -56,11 +55,7 @@ func main() {
log.SetFlags(log.Ldate | log.Ltime | log.Lmicroseconds)
if *use_syslog {
writer, err := syslog.New(syslog.LOG_INFO | syslog.LOG_DAEMON, "lumberjack")
if err != nil {
log.Fatalf("Failed to open syslog: %s\n", err)
}
log.SetOutput(writer)
configureSyslog()
}
// Prospect the globs/paths given on the command line and launch harvesters
......
package main
import (
"log"
"log/syslog"
)
func configureSyslog() {
writer, err := syslog.New(syslog.LOG_INFO | syslog.LOG_DAEMON, "lumberjack")
if err != nil {
log.Fatalf("Failed to open syslog: %s\n", err)
return
}
log.SetOutput(writer)
}
package main
import "log"
func configureSyslog() {
log.Logf("Logging to syslog not supported on this platform\n");)
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment