@@ -12,14 +12,15 @@ pub mod __macros_impl;
12
12
///
13
13
/// The macro accepts the following syntax:
14
14
///
15
- /// ```rust,ignore
16
- /// span!(
17
- /// parent: tracing::Span, // optional, can emit this
18
- /// level: tracing::Level, // optional
19
- /// "format string", // required, must be a format string accepted by `format!()`
20
- /// attr = value, // optional attributes, can be repeated
21
- /// .. // as many additional attr = value pairs as desired
22
- /// )
15
+ /// ```rust
16
+ /// # let value = 42;
17
+ /// logfire::span!(
18
+ /// parent: tracing::Span::current(), // optional, tracing::Span
19
+ /// level: tracing::Level::INFO, // optional, tracing::Level
20
+ /// "format string", // required, must be a format string accepted by `format!()`
21
+ /// attr = value, // optional, attribute key and value pair
22
+ /// // .. // as many additional attr = value pairs as desired
23
+ /// );
23
24
/// ```
24
25
///
25
26
/// ## Attributes
@@ -28,7 +29,7 @@ pub mod __macros_impl;
28
29
///
29
30
/// `dotted.name = value` is also supported (and encouraged by Opentelemetry) to namespace
30
31
/// attributes. However, dotted names are not supported in Rust format strings.
31
- //
32
+ ///
32
33
/// ## Formatting
33
34
///
34
35
/// The format string only accepts arguments by name. These can either be explicitly passed
@@ -157,14 +158,15 @@ macro_rules! debug {
157
158
///
158
159
/// The macro accepts the following syntax:
159
160
///
160
- /// ```rust,ignore
161
- /// log!(
162
- /// parent: tracing::Span, // optional, can emit this
163
- /// tracing::Level, // required, see `info!` and variants for convenience
164
- /// "format string", // required, must be a format string accepted by `format!()`
165
- /// attr = value, // optional attributes, can be repeated
166
- /// .. // as many additional arg = value pairs as desired
167
- /// )
161
+ /// ```rust
162
+ /// # let value = 42;
163
+ /// logfire::log!(
164
+ /// parent: tracing::Span::current(), // optional, tracing::Span
165
+ /// tracing::Level::INFO, // required, see `info!` and variants for convenience
166
+ /// "format string", // required, must be a format string accepted by `format!()`
167
+ /// attr = value, // optional, attribute key and value pair
168
+ /// // .. // as many additional attr = value pairs as desired
169
+ /// );
168
170
/// ```
169
171
///
170
172
/// ## Attributes
@@ -250,6 +252,6 @@ macro_rules! log {
250
252
$crate:: __macros_impl:: log!( parent: $parent, $level, $format, $( $( $path) .+ $( = $value) ?) ,* )
251
253
} ;
252
254
( $level: expr, $format: expr $( , $( $path: ident) .+ $( = $value: expr) ?) * $( , ) ?) => {
253
- $crate:: __macros_impl:: log!( parent: & tracing:: Span :: current( ) , $level, $format, $( $( $path) .+ $( = $value) ?) ,* )
255
+ $crate:: __macros_impl:: log!( parent: tracing:: Span :: current( ) , $level, $format, $( $( $path) .+ $( = $value) ?) ,* )
254
256
} ;
255
257
}
0 commit comments