Skip to content

Introduce LoggingHelper#1385

Merged
st0012 merged 5 commits intomasterfrom
refactor-loggers
Apr 10, 2021
Merged

Introduce LoggingHelper#1385
st0012 merged 5 commits intomasterfrom
refactor-loggers

Conversation

@st0012
Copy link
Copy Markdown
Contributor

@st0012 st0012 commented Apr 5, 2021

This PR centralizes logging logic inside a module. This will help introduce more advanced logging helpers with the new debug option in #1297.

@st0012 st0012 force-pushed the refactor-loggers branch 4 times, most recently from 020f1dc to 7df9a5a Compare April 10, 2021 07:17
@st0012 st0012 force-pushed the refactor-loggers branch from 7df9a5a to 4f183a2 Compare April 10, 2021 07:23
@st0012 st0012 added this to the 4.4.0 milestone Apr 10, 2021
@st0012 st0012 marked this pull request as ready for review April 10, 2021 07:31
@st0012 st0012 changed the title Refactor loggers Introduce LoggingHelper Apr 10, 2021
@codecov-io
Copy link
Copy Markdown

codecov-io commented Apr 10, 2021

Codecov Report

Merging #1385 (b91a5ba) into master (2ccfcf3) will increase coverage by 0.50%.
The diff coverage is 97.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1385      +/-   ##
==========================================
+ Coverage   98.10%   98.60%   +0.50%     
==========================================
  Files         208      114      -94     
  Lines        9264     5460    -3804     
==========================================
- Hits         9088     5384    -3704     
+ Misses        176       76     -100     
Impacted Files Coverage Δ
sentry-ruby/lib/sentry/configuration.rb 97.43% <80.00%> (+0.01%) ⬆️
sentry-ruby/lib/sentry/client.rb 97.14% <83.33%> (+0.04%) ⬆️
sentry-ruby/lib/sentry-ruby.rb 100.00% <100.00%> (ø)
sentry-ruby/lib/sentry/background_worker.rb 100.00% <100.00%> (ø)
sentry-ruby/lib/sentry/transaction.rb 100.00% <100.00%> (ø)
sentry-ruby/lib/sentry/transport.rb 97.43% <100.00%> (+0.21%) ⬆️
sentry-ruby/lib/sentry/transport/http_transport.rb 100.00% <100.00%> (ø)
sentry-ruby/lib/sentry/utils/logging_helper.rb 100.00% <100.00%> (ø)
...ntry-ruby/spec/sentry/client/event_sending_spec.rb 99.45% <100.00%> (+<0.01%) ⬆️
sentry-ruby/spec/sentry/client_spec.rb 96.24% <100.00%> (+0.46%) ⬆️
... and 111 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ccfcf3...b91a5ba. Read the comment docs.

@st0012 st0012 merged commit 6274258 into master Apr 10, 2021
@st0012 st0012 deleted the refactor-loggers branch April 10, 2021 07:40
@agrobbin
Copy link
Copy Markdown
Contributor

@st0012 since this was introduced, Sentry has gotten a bit noisier, particularly at app startup:

D, [2021-07-22T12:01:45.585642 #4] DEBUG -- sentry: Sentry HTTP Transport connecting to [redacted]
D, [2021-07-22T12:01:45.586754 #4] DEBUG -- sentry: config.async is set, BackgroundWorker is disabled

Neither of these pieces of information are really helpful/informative, even when debugging, and I'm wondering if some kind of configuration option could be made available to turn off these kinds of startup messages.

@nvolker
Copy link
Copy Markdown

nvolker commented Jan 14, 2022

Also noticed a lot more noise on the INFO front @agrobbin. Is there a way to easily disable this or change the logging level for only Sentry (not my application logger's level)? So that I don't get INFO logs, only WARN+ logs? @st0012

Sending envelope [event] 239be5b06db81a09bdc3186d66723b21 to Sentry
Sending envelope [event] 239be5b06db81a09bdc3186d66723b22 to Sentry
Sending envelope [event] 239be5b06db81a09bdc3186d66723b23 to Sentry
Sending envelope [event] 239be5b06db81a09bdc3186d66723b24 to Sentry
Sending envelope [event] 239be5b06db81a09bdc3186d66723b25 to Sentry
Sending envelope [event] 239be5b06db81a09bdc3186d66723b26 to Sentry
Sending envelope [event] 239be5b06db81a09bdc3186d66723b27 to Sentry

@st0012
Copy link
Copy Markdown
Contributor Author

st0012 commented Feb 12, 2022

@agrobbin @nvolker Sorry for the long delay. I just spotted this during PR searching.
Uou can give the SDK its own logger to: 1) silent the SDK logging completely 2) give it a different log level.

Example:

config.logger =Logger.new(nil)

# or

config.logger = Logger.new($stdout)
config.logger.level = Logger::WARN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants