Skip to content

Commit

Permalink
Log to stdout as we previously did, and clean up command line flags docs
Browse files Browse the repository at this point in the history
  • Loading branch information
driskell committed Jul 13, 2014
1 parent 56d788c commit f67861e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/log-courier/log-courier.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/log-courier/log-courier_nonwindows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit f67861e

Please sign in to comment.