Skip to content

Commit 7dcd354

Browse files
committed
Handle breaking change with sentry_ruby gem
1 parent eb793bf commit 7dcd354

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/semantic_logger/appender/sentry_ruby.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ class SentryRuby < SemanticLogger::Subscriber
4040
def initialize(level: :error, **args, &block)
4141
# Replace the Sentry Ruby logger so that we can identify its log
4242
# messages and not forward them to Sentry
43-
::Sentry.init { |config| config.logger = SemanticLogger[::Sentry] } unless ::Sentry.initialized?
43+
unless ::Sentry.initialized?
44+
::Sentry.init do |config|
45+
logger = SemanticLogger[::Sentry]
46+
config.respond_to?(:sdk_logger=) ? config.sdk_logger = logger : config.logger = logger
47+
end
48+
end
4449
super
4550
end
4651

0 commit comments

Comments
 (0)