From f67861e069d7c9ba8e8197d9a338f01a0ebb1f6b Mon Sep 17 00:00:00 2001 From: Driskell Date: Sun, 13 Jul 2014 16:30:34 +0100 Subject: [PATCH] Log to stdout as we previously did, and clean up command line flags docs --- README.md | 6 ++---- src/log-courier/log-courier.go | 2 +- src/log-courier/log-courier_nonwindows.go | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2be237e1..0989240e 100644 --- a/README.md +++ b/README.md @@ -92,11 +92,9 @@ The log-courier command accepts the following command line options. -config="": The config file to load -config-test=false: Test the configuration specified by -config and exit -cpuprofile="": write cpu profile to file - -from-beginning=false: Read new files from the beginning, instead of the end - -idle-flush-time=5s: Maximum time to wait for a full spool before flushing anyway + -from-beginning=false: On first run, read new files from the beginning instead of the end -list-supported=false: List supported transports and codecs - -log-to-syslog=false: Log to syslog instead of stdout - -spool-size=1024: Maximum number of events to spool before a flush is forced. + -log-to-syslog=false: Log to syslog as well as stdout -version=false: show version information ## Documentation diff --git a/src/log-courier/log-courier.go b/src/log-courier/log-courier.go index 95bec305..b37cce45 100644 --- a/src/log-courier/log-courier.go +++ b/src/log-courier/log-courier.go @@ -267,7 +267,7 @@ func (lc *LogCourier) startUp() { func (lc *LogCourier) configureLogging() { // First, the stdout backend backends := make([]logging.Backend, 1) - stderr_backend := logging.NewLogBackend(os.Stderr, "", stdlog.LstdFlags|stdlog.Lmicroseconds) + stderr_backend := logging.NewLogBackend(os.Stdout, "", stdlog.LstdFlags|stdlog.Lmicroseconds) backends[0] = stderr_backend // Set backends BEFORE log level (or we reset log level) diff --git a/src/log-courier/log-courier_nonwindows.go b/src/log-courier/log-courier_nonwindows.go index 5e2b1024..5c5cfac1 100644 --- a/src/log-courier/log-courier_nonwindows.go +++ b/src/log-courier/log-courier_nonwindows.go @@ -44,12 +44,12 @@ func NewLogCourierPlatform() LogCourierPlatform { } func (lcp *LogCourierPlatformOther) Init() { - flag.BoolVar(&lcp.syslog, "log-to-syslog", false, "Log to syslog instead of stdout") + flag.BoolVar(&lcp.syslog, "log-to-syslog", false, "Log to syslog as well as stdout") } func (lcp *LogCourierPlatformOther) ConfigureLogging(backends []logging.Backend) { // Make it color if it's a TTY - if lcp.isatty(os.Stderr) { + if lcp.isatty(os.Stdout) { backends[0].(*logging.LogBackend).Color = true }