Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add threshold to always log fatal logs #4707

Merged
merged 3 commits into from
Jan 14, 2025

Conversation

philprime
Copy link
Contributor

📜 Description

Introduces a new constant in SentryLog to configure a log level that will always be logged.

💡 Motivation and Context

Closes #4467

💚 How did you test it?

I added a statement SENTRY_LOG_FATAL(@"test") in the SDK install code and checked if it gets printed.

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

none

Copy link

github-actions bot commented Jan 13, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 43329a1

@philprime philprime changed the title feat: add always log level feat: add threshold to always log fatal logs Jan 13, 2025
Copy link

codecov bot commented Jan 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.207%. Comparing base (6b973b2) to head (43329a1).
Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4707       +/-   ##
=============================================
+ Coverage   91.149%   91.207%   +0.057%     
=============================================
  Files          623       624        +1     
  Lines        71759     72095      +336     
  Branches     25950     26227      +277     
=============================================
+ Hits         65408     65756      +348     
+ Misses        6257      6240       -17     
- Partials        94        99        +5     
Files with missing lines Coverage Δ
Sources/Swift/Tools/SentryLog.swift 74.468% <100.000%> (+3.736%) ⬆️
Tests/SentryTests/Helper/SentryLogTests.swift 100.000% <100.000%> (ø)

... and 61 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

Copy link
Contributor

@brustolin brustolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I will leave the guard thing to your best judgement.

Copy link

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1228.53 ms 1252.54 ms 24.01 ms
Size 22.31 KiB 768.52 KiB 746.21 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
b695b61 1221.71 ms 1249.18 ms 27.47 ms
0589699 1243.25 ms 1252.60 ms 9.35 ms
3ea21f5 1250.80 ms 1258.88 ms 8.08 ms
407ff99 1190.89 ms 1237.18 ms 46.29 ms
904d7fa 1225.73 ms 1249.22 ms 23.49 ms
c471221 1224.16 ms 1241.59 ms 17.43 ms
1928267 1200.94 ms 1227.17 ms 26.23 ms
09311b6 1238.67 ms 1255.04 ms 16.37 ms
ed49f0c 1215.94 ms 1245.63 ms 29.69 ms
973d574 1240.86 ms 1255.83 ms 14.98 ms

App size

Revision Plain With Sentry Diff
b695b61 21.90 KiB 707.65 KiB 685.75 KiB
0589699 21.58 KiB 656.60 KiB 635.02 KiB
3ea21f5 22.84 KiB 402.63 KiB 379.78 KiB
407ff99 20.76 KiB 427.86 KiB 407.10 KiB
904d7fa 20.76 KiB 432.87 KiB 412.11 KiB
c471221 22.85 KiB 413.89 KiB 391.04 KiB
1928267 22.30 KiB 730.78 KiB 708.47 KiB
09311b6 21.58 KiB 654.67 KiB 633.09 KiB
ed49f0c 21.58 KiB 632.13 KiB 610.55 KiB
973d574 21.58 KiB 542.38 KiB 520.80 KiB

@philprime philprime merged commit 72e34fa into main Jan 14, 2025
71 checks passed
@philprime philprime deleted the philprime/4467-change-default-log-level branch January 14, 2025 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change default log level to warning
2 participants