@@ -81,7 +81,7 @@ impl TracingTimer {
81
81
#[ macro_export]
82
82
macro_rules! timer {
83
83
( $level: expr, $string: expr) => { {
84
- static CALLSITE : tracing:: callsite:: DefaultCallsite = tracing:: callsite2! {
84
+ static __CALLSITE : tracing:: callsite:: DefaultCallsite = tracing:: callsite2! {
85
85
name: tracing:: __macro_support:: concat!(
86
86
"event " ,
87
87
file!( ) ,
@@ -94,7 +94,7 @@ macro_rules! timer {
94
94
fields: [ ]
95
95
} ;
96
96
97
- $crate:: tracing_timer:: TracingTimer :: new_debug( & CALLSITE , $string. into( ) , $level)
97
+ $crate:: tracing_timer:: TracingTimer :: new_debug( & __CALLSITE , $string. into( ) , $level)
98
98
} } ;
99
99
100
100
( $string: expr) => {
@@ -109,7 +109,9 @@ mod tests {
109
109
async fn test_timer_name ( ) {
110
110
use tracing:: { span, Level } ;
111
111
112
- tracing_subscriber:: fmt:: init ( ) ;
112
+ tracing_subscriber:: fmt ( ) . with_max_level ( tracing:: Level :: DEBUG ) . init ( ) ;
113
+
114
+ tracing:: warn!( "Starting test..." ) ;
113
115
114
116
mod time123 {
115
117
pub async fn run ( ) {
@@ -128,6 +130,8 @@ mod tests {
128
130
129
131
let _timer_guard = timer ! ( "in span" ) ;
130
132
tokio:: time:: sleep ( instant:: Duration :: from_millis ( 256 ) ) . await ;
133
+
134
+ tracing:: warn!( "Test about to finish." ) ;
131
135
// Displays: 2023-08-25T15:18:31.427070Z DEBUG le 256ms span:
132
136
// matrix_sdk_common::tracing_timer::tests: in span finished in 257ms
133
137
}
0 commit comments