add quiet flag

This commit is contained in:
shoopea 2023-06-29 23:46:53 +02:00
parent f94f9b9f71
commit 89ae6ea612
2 changed files with 8 additions and 4 deletions

View File

@ -13,6 +13,7 @@ var (
cfgFile = flag.String("config", "config.json", "config file")
isDaemon = flag.Bool("daemon", false, "run as daemon")
debug = flag.Bool("debug", false, "log debug messages")
quiet = flag.Bool("quiet", false, "remove most log messages")
logFile = flag.String("logfile", "", "log file")
cfg Config
email *Email
@ -26,6 +27,9 @@ func main() {
if *debug {
log.SetLevel(log.DebugLevel)
}
if *quiet {
log.SetLevel(log.WarnLevel)
}
if *logFile != "" {
if f, err := os.OpenFile(*logFile, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0644); err != nil {
log.Printf("Cannot open logfile (%s)", err)

View File

@ -1,7 +1,7 @@
// Code generated by version.sh (@generated) DO NOT EDIT.
package main
var githash = "0e0e5db"
var githash = "f94f9b9"
var branch = "v2"
var buildstamp = "2023-06-29_21:36:34"
var commits = "59"
var version = "0e0e5db-b59 - 2023-06-29_21:36:34"
var buildstamp = "2023-06-29_21:46:39"
var commits = "60"
var version = "f94f9b9-b60 - 2023-06-29_21:46:39"