mirror of
https://github.com/nikdoof/hapz2m.git
synced 2026-01-30 10:28:21 +00:00
Added quiet mode for reduced verbosity
This is useful to reduce clutter if you're running the service and it's writing logs to the main syslog.
This commit is contained in:
@@ -28,6 +28,7 @@ var (
|
||||
configFile = flag.String("config", "/etc/hapz2m.conf", "config file")
|
||||
dbPath = flag.String("db", "/var/lib/hapz2m", "db path")
|
||||
debugMode = flag.Bool("debug", false, "enable debug messages")
|
||||
quietMode = flag.Bool("quiet", false, "reduce verbosity by not showing received upates")
|
||||
)
|
||||
|
||||
// config struct
|
||||
@@ -77,6 +78,11 @@ func main() {
|
||||
br.Username = cfg.Username
|
||||
br.Password = cfg.Password
|
||||
br.DebugMode = *debugMode
|
||||
br.QuietMode = *quietMode
|
||||
|
||||
if *debugMode && *quietMode {
|
||||
log.Fatalf("-quiet and -debug options are mutually-exclusive")
|
||||
}
|
||||
|
||||
// validate ListenAddr if specified
|
||||
if cfg.ListenAddr != "" {
|
||||
|
||||
Reference in New Issue
Block a user