From 48b98bc7c9ef9f81e377231e2b6050b25586af9f Mon Sep 17 00:00:00 2001 From: vabshere Date: Tue, 25 Aug 2020 17:12:03 +0530 Subject: [PATCH] abort logging if custom service is used --- surveillance/sentry.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/surveillance/sentry.go b/surveillance/sentry.go index f52e8e1..82ce121 100644 --- a/surveillance/sentry.go +++ b/surveillance/sentry.go @@ -72,6 +72,9 @@ func (wrapper *Sentry) Capture(err error, _panic bool) { // Setting the stacktrace of the error as an extra along with any other extras set in the error if extras := errors.Extras(err); extras != nil{ + if abortLog, ok := extras["custom_service"]; ok && abortLog.(bool) { + return + } scope.SetExtras(extras) scope.SetExtra("stacktrace", errors.Stacktrace(err)) } else {