mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-07 00:00:08 +02:00
trace: Remove default trace level and make levels mandatory on span! macro (#1025)
## Motivation Was determined that having the span! macro default to the TRACE level is probably not ideal (see discussion on #952). Closes #1013 ## Solution Remove default trace level and make log lvl mandatory on span! macro, and add the respective `trace_span!`, `debug_span!`, `info_span!`, `warn_span!` and `error_span!` macros that behave as span! macro, but with defined log levels ## Notes I think this is it, also removed some captures that were repeated, and some testcases that also seemed repeated after adding the mandatory log level, but please review it, if more tests or examples are needed happy to provide (tried to find a way to get the generated macros log level, but didn't find one, if there is a way i can add tests to assert that the generated macro has the matching log level ). thanks
This commit is contained in:
committed by
Eliza Weisman
parent
599955f716
commit
597f271c08
@@ -51,15 +51,15 @@ fn test_static_max_level_features() {
|
||||
trace!("");
|
||||
last(&a, None);
|
||||
|
||||
span!(level: Level::ERROR, "");
|
||||
span!(Level::ERROR, "");
|
||||
last(&a, None);
|
||||
span!(level: Level::WARN, "");
|
||||
span!(Level::WARN, "");
|
||||
last(&a, None);
|
||||
span!(level: Level::INFO, "");
|
||||
span!(Level::INFO, "");
|
||||
last(&a, None);
|
||||
span!(level: Level::DEBUG, "");
|
||||
span!(Level::DEBUG, "");
|
||||
last(&a, None);
|
||||
span!(level: Level::TRACE, "");
|
||||
span!(Level::TRACE, "");
|
||||
last(&a, None);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user