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

use Trace.WriteLine for TraceDiagnosticLogger #1475

Merged
merged 3 commits into from
Feb 7, 2022

Conversation

SimonCropp
Copy link
Contributor

@SimonCropp SimonCropp commented Feb 7, 2022

  • force Trace in TraceDiagnosticLogger using #define TRACE
  • this unlocks using Trace.WriteLine instead of iterating Listeners
  • No longer need catch (ArgumentOutOfRangeException)
  • Fixes race condition where the listener.WriteLine($"{logLevel,7}: {string.Format(message, args)}"); and listener.WriteLine(exception); can interleave with another Trace.WriteLine causing a confusing sequence of log lines.
  • Add a test for TraceDiagnosticLogger

@getsentry getsentry deleted a comment from github-actions bot Feb 7, 2022
@codecov-commenter
Copy link

codecov-commenter commented Feb 7, 2022

Codecov Report

Merging #1475 (fbe15d2) into main (8b4d317) will increase coverage by 0.06%.
The diff coverage is 100.00%.

❗ Current head fbe15d2 differs from pull request most recent head 33553a7. Consider uploading reports for the commit 33553a7 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1475      +/-   ##
==========================================
+ Coverage   84.23%   84.29%   +0.06%     
==========================================
  Files         219      219              
  Lines        7383     7380       -3     
  Branches     1415     1414       -1     
==========================================
+ Hits         6219     6221       +2     
+ Misses        728      724       -4     
+ Partials      436      435       -1     
Impacted Files Coverage Δ
src/Sentry/Infrastructure/TraceDiagnosticLogger.cs 100.00% <100.00%> (+27.27%) ⬆️
src/Sentry/Internal/BackgroundWorker.cs 93.47% <0.00%> (+1.44%) ⬆️

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 8b4d317...33553a7. Read the comment docs.

@SimonCropp SimonCropp merged commit 631fe3e into main Feb 7, 2022
@SimonCropp SimonCropp deleted the TraceDiagnosticLoggerDisposedBug branch February 7, 2022 19:11
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.

4 participants