From 95e6947f9c41c066547f7d100fd2d0083ceb150f Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sat, 23 Jul 2022 18:57:57 -0700 Subject: [PATCH] remove sysinfo from --json mode without --debug (#4159) --- cmd/error.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/error.go b/cmd/error.go index c6163b8e..b2c2a76e 100644 --- a/cmd/error.go +++ b/cmd/error.go @@ -42,7 +42,7 @@ type errorMessage struct { Cause causeMessage `json:"cause"` Type string `json:"type"` CallTrace []probe.TracePoint `json:"trace,omitempty"` - SysInfo map[string]string `json:"sysinfo"` + SysInfo map[string]string `json:"sysinfo,omitempty"` } // fatalIf wrapper function which takes error and selectively prints stack frames if available on debug @@ -62,10 +62,10 @@ func fatal(err *probe.Error, msg string, data ...interface{}) { Message: err.ToGoError().Error(), Error: err.ToGoError(), }, - SysInfo: err.SysInfo, } if globalDebug { errorMsg.CallTrace = err.CallTrace + errorMsg.SysInfo = err.SysInfo } json, e := json.MarshalIndent(struct { Status string `json:"status"`