From f07cb220266da35b36dfba76c412c3a023f0cb72 Mon Sep 17 00:00:00 2001 From: Henry Blyth Date: Fri, 26 Feb 2021 14:38:36 +0000 Subject: [PATCH] Stop returning breadcrumbs buffer when logging --- sentry-ruby/CHANGELOG.md | 1 + sentry-ruby/lib/sentry/breadcrumb/sentry_logger.rb | 1 + sentry-ruby/spec/sentry/breadcrumb/sentry_logger_spec.rb | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/sentry-ruby/CHANGELOG.md b/sentry-ruby/CHANGELOG.md index f2ba584d0..b3be75d3d 100644 --- a/sentry-ruby/CHANGELOG.md +++ b/sentry-ruby/CHANGELOG.md @@ -9,6 +9,7 @@ - Fixes [#1307](https://github.com/getsentry/sentry-ruby/issues/1307) - Refactor tracing implementation [#1309](https://github.com/getsentry/sentry-ruby/pull/1309) - Allow configuring BreadcrumbBuffer's size limit [#1310](https://github.com/getsentry/sentry-ruby/pull/1310) +- Return nil from logger methods instead of breadcrumb buffer [#1299](https://github.com/getsentry/sentry-ruby/pull/1299) ## 4.2.2 diff --git a/sentry-ruby/lib/sentry/breadcrumb/sentry_logger.rb b/sentry-ruby/lib/sentry/breadcrumb/sentry_logger.rb index 5dbcbd240..548da4e56 100644 --- a/sentry-ruby/lib/sentry/breadcrumb/sentry_logger.rb +++ b/sentry-ruby/lib/sentry/breadcrumb/sentry_logger.rb @@ -14,6 +14,7 @@ module SentryLogger def add(*args, &block) super add_breadcrumb(*args, &block) + nil end def add_breadcrumb(severity, message = nil, progname = nil) diff --git a/sentry-ruby/spec/sentry/breadcrumb/sentry_logger_spec.rb b/sentry-ruby/spec/sentry/breadcrumb/sentry_logger_spec.rb index e95685a2a..d0b4c38b1 100644 --- a/sentry-ruby/spec/sentry/breadcrumb/sentry_logger_spec.rb +++ b/sentry-ruby/spec/sentry/breadcrumb/sentry_logger_spec.rb @@ -20,6 +20,10 @@ expect(breadcrumb.message).to eq("foo") end + it "does not affect the return of the logger call" do + expect(logger.info("foo")).to be_nil + end + it "ignores traces with #{Sentry::LOGGER_PROGNAME}" do logger.info(Sentry::LOGGER_PROGNAME) { "foo" }