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

tests: Use tracing::subscriber::DefaultGuard to set subscriber #8023

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Jan 29, 2024

This avoids try_init() failing because a default subscriber is already registered globally. set_default() will register a temporary one only for the lifetime of the returned scope guard.

This avoids `try_init()` failing because a default subscriber is already registered globally. `set_default()` will register a temporary one only for the lifetime of the returned scope guard.
@Turbo87 Turbo87 added C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear A-backend ⚙️ labels Jan 29, 2024
Copy link

codecov bot commented Jan 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3e542d9) 87.48% compared to head (c9eda7d) 87.49%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8023      +/-   ##
==========================================
+ Coverage   87.48%   87.49%   +0.01%     
==========================================
  Files         254      254              
  Lines       24995    24999       +4     
==========================================
+ Hits        21867    21873       +6     
+ Misses       3128     3126       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Turbo87 Turbo87 merged commit aa0f784 into rust-lang:main Jan 29, 2024
8 checks passed
@Turbo87 Turbo87 deleted the tracing-subscriber branch January 29, 2024 16:27
Turbo87 added a commit to Turbo87/crates.io that referenced this pull request Mar 29, 2024
Turbo87 added a commit to Turbo87/crates.io that referenced this pull request Mar 29, 2024
Turbo87 added a commit that referenced this pull request Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant