sentry-ruby 5.25.0 → 5.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +6 -9
- data/lib/sentry/client.rb +4 -2
- data/lib/sentry/std_lib_logger.rb +50 -0
- data/lib/sentry/version.rb +1 -1
- data/lib/sentry-ruby.rb +1 -0
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb03eb536d1060c3a097a1ff3726ae71c8ffbd0012580d75c491665e054ac7c1
|
4
|
+
data.tar.gz: 65df577369b281f3e1d1d9335e78786a800947c2014b35608d88c863458f24ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4e398e02a8fe619afc8982760c290a168785c4557dca30767fbeb039032d7907135e84d0598a5ac90b7b1cfb8413ceda83ebe4647702ba5c10c613ff0543574
|
7
|
+
data.tar.gz: 285a3e0f650a41bcb6cc4539f48c7efcb9bc3442f31c76f301089c4672e6d9c790f407dd9d53db4e216df4eacd9be019b5bc46e453437fa1614aa48555541c9a
|
data/Rakefile
CHANGED
@@ -6,16 +6,13 @@ CLOBBER.include "pkg"
|
|
6
6
|
require "bundler/gem_helper"
|
7
7
|
Bundler::GemHelper.install_tasks(name: "sentry-ruby")
|
8
8
|
|
9
|
-
|
9
|
+
require_relative "../lib/sentry/test/rake_tasks"
|
10
10
|
|
11
11
|
ISOLATED_SPECS = "spec/isolated/**/*_spec.rb"
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Sentry::Test::RakeTasks.define_spec_tasks(
|
14
|
+
isolated_specs_pattern: ISOLATED_SPECS,
|
15
|
+
spec_exclude_pattern: ISOLATED_SPECS
|
16
|
+
)
|
16
17
|
|
17
|
-
|
18
|
-
task.pattern = ISOLATED_SPECS
|
19
|
-
end
|
20
|
-
|
21
|
-
task default: [:spec, :isolated_specs]
|
18
|
+
task default: [:spec, :"spec:isolated"]
|
data/lib/sentry/client.rb
CHANGED
@@ -42,7 +42,9 @@ module Sentry
|
|
42
42
|
|
43
43
|
@spotlight_transport = SpotlightTransport.new(configuration) if configuration.spotlight
|
44
44
|
|
45
|
-
|
45
|
+
if configuration.enable_logs
|
46
|
+
@log_event_buffer = LogEventBuffer.new(configuration, self).start
|
47
|
+
end
|
46
48
|
end
|
47
49
|
|
48
50
|
# Applies the given scope's data to the event and sends it to Sentry.
|
@@ -114,7 +116,7 @@ module Sentry
|
|
114
116
|
def flush
|
115
117
|
transport.flush if configuration.sending_to_dsn_allowed?
|
116
118
|
spotlight_transport.flush if spotlight_transport
|
117
|
-
@log_event_buffer
|
119
|
+
@log_event_buffer&.flush
|
118
120
|
end
|
119
121
|
|
120
122
|
# Initializes an Event object with the given exception. Returns `nil` if the exception's class is excluded from reporting.
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Sentry
|
4
|
+
# Ruby Logger support Add commentMore actions
|
5
|
+
# intercepts any logger instance and send the log to Sentry too.
|
6
|
+
module StdLibLogger
|
7
|
+
SEVERITY_MAP = {
|
8
|
+
0 => :debug,
|
9
|
+
1 => :info,
|
10
|
+
2 => :warn,
|
11
|
+
3 => :error,
|
12
|
+
4 => :fatal
|
13
|
+
}.freeze
|
14
|
+
|
15
|
+
def add(severity, message = nil, progname = nil, &block)
|
16
|
+
result = super
|
17
|
+
|
18
|
+
return unless Sentry.initialized? && Sentry.get_current_hub
|
19
|
+
|
20
|
+
# exclude sentry SDK logs -- to prevent recursive log action,
|
21
|
+
# do not process internal logs again
|
22
|
+
if message.nil? && progname != Sentry::Logger::PROGNAME
|
23
|
+
|
24
|
+
# handle different nature of Ruby Logger class:
|
25
|
+
# inspo from Sentry::Breadcrumb::SentryLogger
|
26
|
+
if block_given?
|
27
|
+
message = yield
|
28
|
+
else
|
29
|
+
message = progname
|
30
|
+
end
|
31
|
+
|
32
|
+
message = message.to_s.strip
|
33
|
+
|
34
|
+
if !message.nil? && message != Sentry::Logger::PROGNAME && method = SEVERITY_MAP[severity]
|
35
|
+
Sentry.logger.send(method, message)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
result
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
Sentry.register_patch(:logger) do |config|
|
45
|
+
if config.enable_logs
|
46
|
+
::Logger.prepend(Sentry::StdLibLogger)
|
47
|
+
else
|
48
|
+
config.sdk_logger.warn(":logger patch enabled but `enable_logs` is turned off - skipping applying patch")
|
49
|
+
end
|
50
|
+
end
|
data/lib/sentry/version.rb
CHANGED
data/lib/sentry-ruby.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sentry-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.26.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sentry Team
|
@@ -129,6 +129,7 @@ files:
|
|
129
129
|
- lib/sentry/session.rb
|
130
130
|
- lib/sentry/session_flusher.rb
|
131
131
|
- lib/sentry/span.rb
|
132
|
+
- lib/sentry/std_lib_logger.rb
|
132
133
|
- lib/sentry/structured_logger.rb
|
133
134
|
- lib/sentry/test_helper.rb
|
134
135
|
- lib/sentry/threaded_periodic_worker.rb
|
@@ -154,15 +155,15 @@ files:
|
|
154
155
|
- lib/sentry/version.rb
|
155
156
|
- sentry-ruby-core.gemspec
|
156
157
|
- sentry-ruby.gemspec
|
157
|
-
homepage: https://github.com/getsentry/sentry-ruby/tree/5.
|
158
|
+
homepage: https://github.com/getsentry/sentry-ruby/tree/5.26.0/sentry-ruby
|
158
159
|
licenses:
|
159
160
|
- MIT
|
160
161
|
metadata:
|
161
|
-
homepage_uri: https://github.com/getsentry/sentry-ruby/tree/5.
|
162
|
-
source_code_uri: https://github.com/getsentry/sentry-ruby/tree/5.
|
163
|
-
changelog_uri: https://github.com/getsentry/sentry-ruby/blob/5.
|
162
|
+
homepage_uri: https://github.com/getsentry/sentry-ruby/tree/5.26.0/sentry-ruby
|
163
|
+
source_code_uri: https://github.com/getsentry/sentry-ruby/tree/5.26.0/sentry-ruby
|
164
|
+
changelog_uri: https://github.com/getsentry/sentry-ruby/blob/5.26.0/CHANGELOG.md
|
164
165
|
bug_tracker_uri: https://github.com/getsentry/sentry-ruby/issues
|
165
|
-
documentation_uri: http://www.rubydoc.info/gems/sentry-ruby/5.
|
166
|
+
documentation_uri: http://www.rubydoc.info/gems/sentry-ruby/5.26.0
|
166
167
|
rdoc_options: []
|
167
168
|
require_paths:
|
168
169
|
- lib
|