From 92b3181672b62052d4193749cd02f4be7d91e2ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Sat, 25 Apr 2020 21:24:34 +0200 Subject: Add debug output --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'main.go') diff --git a/main.go b/main.go index 415d19f..026ef0a 100644 --- a/main.go +++ b/main.go @@ -16,6 +16,7 @@ import ( var cfgFile = flag.String("f", "config.yml", "configuration file") var cacheFile = flag.String("c", "feed.cache", "cache file") var verbose = flag.Bool("v", false, "enable verbose output") +var debug = flag.Bool("d", false, "enable debug output") func processFeed(feed *feed.Feed, cfg *config.Config, client *imap.Client, wg *sync.WaitGroup) { defer wg.Done() @@ -46,7 +47,11 @@ func processFeed(feed *feed.Feed, cfg *config.Config, client *imap.Client, wg *s func run() error { flag.Parse() - log.SetDebug(*verbose) + if *debug { + log.SetDebug() + } else if *verbose { + log.SetVerbose() + } log.Print("Starting up...") -- cgit v1.2.3