mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-14 07:08:06 +00:00
Log printing follow no-colors flag #2082
This commit is contained in:
parent
28646c7b50
commit
ef6fb92e7f
@ -71,9 +71,14 @@ yq -P -oy sample.json
|
|||||||
level := logging.WARNING
|
level := logging.WARNING
|
||||||
stringFormat := `[%{level}] %{color}%{time:15:04:05}%{color:reset} %{message}`
|
stringFormat := `[%{level}] %{color}%{time:15:04:05}%{color:reset} %{message}`
|
||||||
|
|
||||||
if verbose {
|
if verbose && forceNoColor {
|
||||||
|
level = logging.DEBUG
|
||||||
|
stringFormat = `[%{level:5.5s}] %{time:15:04:05} %{shortfile:-33s} %{shortfunc:-25s} %{message}`
|
||||||
|
} else if verbose {
|
||||||
level = logging.DEBUG
|
level = logging.DEBUG
|
||||||
stringFormat = `[%{level:5.5s}] %{color}%{time:15:04:05}%{color:bold} %{shortfile:-33s} %{shortfunc:-25s}%{color:reset} %{message}`
|
stringFormat = `[%{level:5.5s}] %{color}%{time:15:04:05}%{color:bold} %{shortfile:-33s} %{shortfunc:-25s}%{color:reset} %{message}`
|
||||||
|
} else if forceNoColor {
|
||||||
|
stringFormat = `[%{level}] %{time:15:04:05} %{message}`
|
||||||
}
|
}
|
||||||
|
|
||||||
var format = logging.MustStringFormatter(stringFormat)
|
var format = logging.MustStringFormatter(stringFormat)
|
||||||
|
Loading…
Reference in New Issue
Block a user