Add verbose level to logger

This commit is contained in:
9seconds
2018-05-31 09:54:20 +03:00
parent a27a8494a6
commit 2cc845f158
+6
View File
@@ -25,6 +25,10 @@ var (
Short('d').
Envar("MTG_DEBUG").
Bool()
verbose = app.Flag("verbose", "Run in verbose mode.").
Short('v').
Envar("MTG_VERBOSE").
Bool()
bindIP = app.Flag("bind-ip", "Which IP to bind to.").
Short('i').
Envar("MTG_IP").
@@ -69,6 +73,8 @@ func main() {
atom := zap.NewAtomicLevel()
if *debug {
atom.SetLevel(zapcore.DebugLevel)
} else if *verbose {
atom.SetLevel(zapcore.InfoLevel)
} else {
atom.SetLevel(zapcore.ErrorLevel)
}