diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-19 15:05:08 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-19 15:05:08 +0200 |
commit | 0b09b3a77b4784e63419114e4c43baf1f3ae2562 (patch) | |
tree | c9c0e12b33cc51833b65bd39566223394d29dc90 /main.go | |
parent | e8c715f6b267d65cb0694704b395bcc236f74195 (diff) | |
download | feed2imap-go-0b09b3a77b4784e63419114e4c43baf1f3ae2562.tar.gz feed2imap-go-0b09b3a77b4784e63419114e4c43baf1f3ae2562.tar.bz2 feed2imap-go-0b09b3a77b4784e63419114e4c43baf1f3ae2562.zip |
Rename util.go to log.go. Add verbose mode
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -2,19 +2,21 @@ package main import ( "flag" - "log" "os" "github.com/Necoro/feed2imap-go/internal/config" + "github.com/Necoro/feed2imap-go/internal/log" "github.com/Necoro/feed2imap-go/internal/parse" - "github.com/Necoro/feed2imap-go/internal/util" ) var cfgFile = flag.String("f", "config.yml", "configuration file") +var verbose = flag.Bool("v", false, "enable verbose output") func run() error { - log.Print("Starting up...") flag.Parse() + log.SetDebug(*verbose) + + log.Print("Starting up...") log.Printf("Reading configuration file '%s'", *cfgFile) cfg, err := config.Load(*cfgFile) @@ -29,7 +31,7 @@ func run() error { func main() { if err := run(); err != nil { - util.Error(err) + log.Error(err) os.Exit(1) } } |