-
Notifications
You must be signed in to change notification settings - Fork 756
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tracing: add
Span::none()
constructor (#147)
* tracing: add `Span::none()` constructor This branch adds a `Span::none()` constructor, which returns a totally disabled span, without requiring a `Metadata` reference. Unlike `new_disabled`, this span will *not* log, even if the log-support feature flag is enabled. It is not constructed by the macors, but is intended for use by users to represent a situation where a span may or may not be present without using `Option<Span>`. A `none` span will silently do nothing when any of its methods are called. If an API for getting the current span is added to `Subscriber`, a `None` span will be returned when there is no currently-entered span, or when the subscriber does not track a current span. Closes #140 Signed-off-by: Eliza Weisman <[email protected]> Co-Authored-By: Jon Gjengset <[email protected]>
- Loading branch information
Showing
1 changed file
with
119 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters