aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-19 15:05:08 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-19 15:05:08 +0200
commit0b09b3a77b4784e63419114e4c43baf1f3ae2562 (patch)
treec9c0e12b33cc51833b65bd39566223394d29dc90 /main.go
parente8c715f6b267d65cb0694704b395bcc236f74195 (diff)
downloadfeed2imap-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 '')
-rw-r--r--main.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/main.go b/main.go
index c155a1b..bbea985 100644
--- a/main.go
+++ b/main.go
@@ -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)
}
}