feat: Add log level options (#75)

This commit is contained in:
Anthony Laibe 2021-10-13 16:18:10 +02:00 committed by GitHub
parent 86cf5304b2
commit 2df2289972
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -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)
}

View File

@ -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"`