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

Add span and event macros that are only enabled in debug mode #12

Closed
hawkw opened this issue Feb 18, 2019 · 2 comments
Closed

Add span and event macros that are only enabled in debug mode #12

hawkw opened this issue Feb 18, 2019 · 2 comments
Labels
crate/macros good first issue Good for newcomers kind/feature New feature or request

Comments

@hawkw
Copy link
Member

hawkw commented Feb 18, 2019

See also tokio-rs/tokio#827 (review).

It would be nice to have debug_span! and debug_event! macros in the tokio-trace-macros crate which are only enabled in debug mode builds.

We can detect debug mode with

#[cfg(debug_assertions)]

In debug mode, these macros would behave identically to the tokio_trace crate's span! and debug! macros. In release mode (i.e. #[cfg(not(debug_assertions))]) the debug_span! macro would always evaluate to a disabled span struct (Span::new_disabled()) while debug_event! would do nothing.

@hawkw
Copy link
Member Author

hawkw commented Mar 7, 2019

tokio-rs/tokio#959 is a proposed change to the tokio-trace crate that would obsolete this.

@hawkw
Copy link
Member Author

hawkw commented Mar 25, 2019

Closed by tokio-rs/tokio#987.

@hawkw hawkw closed this as completed Mar 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate/macros good first issue Good for newcomers kind/feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant