mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-02-09 15:27:11 +00:00
lib/logger: do not clutter -loggerFormat=json
output with stack trace
This should improve json parsing
This commit is contained in:
parent
bd4698bb7a
commit
7f3e3a6034
1 changed files with 4 additions and 0 deletions
|
@ -155,6 +155,10 @@ func logMessage(level, msg string, skipframes int) {
|
||||||
|
|
||||||
switch level {
|
switch level {
|
||||||
case "PANIC":
|
case "PANIC":
|
||||||
|
if *loggerFormat == "json" {
|
||||||
|
// Do not clutter `json` output with panic stack trace
|
||||||
|
os.Exit(-1)
|
||||||
|
}
|
||||||
panic(errors.New(msg))
|
panic(errors.New(msg))
|
||||||
case "FATAL":
|
case "FATAL":
|
||||||
os.Exit(-1)
|
os.Exit(-1)
|
||||||
|
|
Loading…
Reference in a new issue