mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-02 00:11:56 +03:00
Add verbose level to logger
This commit is contained in:
@@ -25,6 +25,10 @@ var (
|
|||||||
Short('d').
|
Short('d').
|
||||||
Envar("MTG_DEBUG").
|
Envar("MTG_DEBUG").
|
||||||
Bool()
|
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.").
|
bindIP = app.Flag("bind-ip", "Which IP to bind to.").
|
||||||
Short('i').
|
Short('i').
|
||||||
Envar("MTG_IP").
|
Envar("MTG_IP").
|
||||||
@@ -69,6 +73,8 @@ func main() {
|
|||||||
atom := zap.NewAtomicLevel()
|
atom := zap.NewAtomicLevel()
|
||||||
if *debug {
|
if *debug {
|
||||||
atom.SetLevel(zapcore.DebugLevel)
|
atom.SetLevel(zapcore.DebugLevel)
|
||||||
|
} else if *verbose {
|
||||||
|
atom.SetLevel(zapcore.InfoLevel)
|
||||||
} else {
|
} else {
|
||||||
atom.SetLevel(zapcore.ErrorLevel)
|
atom.SetLevel(zapcore.ErrorLevel)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user