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)
}
}
with mail creationRené 'Necoro' Neumann4-3/+126 2020-04-20FeeditemsRené 'Necoro' Neumann2-2/+14 2020-04-20GlobalOptionsRené 'Necoro' Neumann3-25/+79 2020-04-19RestructureRené 'Necoro' Neumann6-152/+177 2020-04-19Rename package 'parse' to 'feed'René 'Necoro' Neumann2-3/+3 2020-04-19SELECT is not necessary for most operations -- skip itRené 'Necoro' Neumann2-12/+1 2020-04-19Store path as array -- the delimiter is not always '.'René 'Necoro' Neumann3-36/+44 2020-04-19Split client part to client.goRené 'Necoro' Neumann2-125/+137 2020-04-19IMAP: Create foldersRené 'Necoro' Neumann1-4/+38 2020-04-19Improved IMAPRené 'Necoro' Neumann1-3/+88 2020-04-19Started IMAP connectionRené 'Necoro' Neumann4-0/+152 2020-04-19Use our own logger for debug for convenience sakeRené 'Necoro' Neumann1-2/+3 2020-04-19Fix debug logging m(René 'Necoro' Neumann1-2/+2 2020-04-19Rename util.go to log.go. Add verbose modeRené 'Necoro' Neumann4-24/+54 2020-04-19Clean go.modRené 'Necoro' Neumann2-3/+0 2020-04-19Do not print the parsedCfg anymoreRené 'Necoro' Neumann1-1/+1 2020-04-19Increase go-version to 1.14René 'Necoro' Neumann1-2/+2 2020-04-19CI: go vetRené 'Necoro' Neumann1-0/+3 2020-04-19Fetching and parsing the feedsRené 'Necoro' Neumann5-4/+113 2020-04-19Ignore all config*.ymlRené 'Necoro' Neumann1-1/+1