summaryrefslogtreecommitdiff
path: root/args.go
blob: 4752f538143f2da7c6f3c8535ad63e7e2e17e956 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package log

import (
	arg "github.com/alexflint/go-arg"
)

//
// Attempt to switch logging to syslog on linux
//

var argLog ArgLog

// This struct can be used with the go-arg package
type ArgLog struct {
	LogDebug bool `arg:"--log-debug" help:"show the log gui"`
	LogTmp bool `arg:"--log-tmp" help:"send all output /tmp"`
	LogStdout bool `arg:"--log-stdout" help:"send all output to STDOUT"`
	LogQuiet bool `arg:"--log-quiet" help:"suppress all output"`
}

func init() {
	arg.Register(&argLog)
}

// returns true if --log-debug was passed from the command line
func ArgDebug() bool {
	return argLog.LogDebug
}