lib/logger: do not clutter -loggerFormat=json output with stack trace

This should improve json parsing
This commit is contained in:
Aliaksandr Valialkin 2020-02-04 21:37:23 +02:00
parent bd4698bb7a
commit 7f3e3a6034

View file

@ -155,6 +155,10 @@ func logMessage(level, msg string, skipframes int) {
switch level {
case "PANIC":
if *loggerFormat == "json" {
// Do not clutter `json` output with panic stack trace
os.Exit(-1)
}
panic(errors.New(msg))
case "FATAL":
os.Exit(-1)