From 2df228997239672cecd9d69599688706e822cbb1 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Wed, 13 Oct 2021 16:18:10 +0200 Subject: [PATCH] feat: Add log level options (#75) --- waku.go | 2 +- waku/options.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/waku.go b/waku.go index bf567a77..1d39b9b5 100644 --- a/waku.go +++ b/waku.go @@ -17,7 +17,7 @@ func main() { os.Exit(1) } - lvl, err := logging.LevelFromString("info") + lvl, err := logging.LevelFromString(options.LogLevel) if err != nil { os.Exit(1) } diff --git a/waku/options.go b/waku/options.go index 7072f195..67c4bef4 100644 --- a/waku/options.go +++ b/waku/options.go @@ -71,6 +71,7 @@ type Options struct { KeepAlive int `long:"keep-alive" default:"20" description:"Interval in seconds for pinging peers to keep the connection alive."` UseDB bool `long:"use-db" description:"Use SQLiteDB to persist information"` DBPath string `long:"dbpath" default:"./store.db" description:"Path to DB file"` + LogLevel string `short:"l" long:"log-level" description:"Define the logging level, supported strings are: DEBUG, INFO, WARN, ERROR, DPANIC, PANIC, FATAL, and their lower-case forms." default:"INFO"` Relay RelayOptions `group:"Relay Options"` Store StoreOptions `group:"Store Options"`