• Home
  • Raw
  • Download

Lines Matching full:instrument

5 //! [`#[instrument]`][instrument] procedural macro attribute.
22 //! The [`#[instrument]`][instrument] attribute can now be added to a function
27 //! use tracing::instrument;
29 //! #[instrument]
39 //! [instrument]: macro@self::instrument
108 /// `#[instrument]` macro, followed by an equals sign and a string literal. For
112 /// # use tracing_attributes::instrument;
115 /// #[instrument(name = "my_span")]
122 /// the `#[instrument]` macro, followed by an equals sign and a string literal
128 /// # use tracing_attributes::instrument;
131 /// #[instrument(target = "my_crate::some_special_target")]
143 /// # use tracing_attributes::instrument;
145 /// #[instrument(level = "trace")]
155 /// the argument's name inside the `skip()` argument on the `#[instrument]`
168 /// # use tracing_attributes::instrument;
174 /// #[instrument(skip(non_debug))]
180 /// #[instrument(skip_all)]
189 /// # use tracing_attributes::instrument;
198 /// #[instrument(skip(self))]
209 /// `#[instrument]` macro. Strings, integers or boolean literals are accepted values
226 /// # use tracing_attributes::instrument;
230 /// #[instrument(fields(next = i + 1))]
253 /// # use tracing_attributes::instrument;
257 /// #[instrument(fields(http.uri = req.uri(), http.method = req.method()))]
267 /// # use tracing_attributes::instrument;
280 /// #[instrument(skip(self), fields(self.name = %self.name))]
290 /// # use tracing_attributes::instrument;
294 /// #[instrument(fields(result))]
315 /// # use tracing_attributes::instrument;
316 /// #[instrument]
326 /// # use tracing_attributes::instrument;
328 /// #[instrument(level = Level::DEBUG)]
338 /// # use tracing_attributes::instrument;
339 /// #[instrument(name = "my_name")]
346 /// # use tracing_attributes::instrument;
347 /// #[instrument(target = "my_target")]
354 /// # use tracing_attributes::instrument;
355 /// #[instrument(parent = None)]
361 /// # use tracing_attributes::instrument;
371 /// #[instrument(parent = &self.span, skip(self))]
377 /// # use tracing_attributes::instrument;
378 /// #[instrument(follows_from = causes)]
386 /// # use tracing_attributes::instrument;
387 /// #[instrument(follows_from = [cause])]
397 /// # use tracing_attributes::instrument;
400 /// #[instrument(skip(non_debug))]
409 /// # use tracing_attributes::instrument;
410 /// #[instrument(fields(foo="bar", id=1, show=true))]
416 /// Adding the `ret` argument to `#[instrument]` will emit an event with the function's
420 /// # use tracing_attributes::instrument;
421 /// #[instrument(ret)]
426 /// The return value event will have the same level as the span generated by `#[instrument]`.
433 /// # use tracing_attributes::instrument;
435 /// #[instrument(ret(level = Level::WARN))]
449 /// # use tracing_attributes::instrument;
450 /// #[instrument(ret(Display))]
460 /// # use tracing_attributes::instrument;
461 /// #[instrument(err)]
472 /// # use tracing_attributes::instrument;
474 /// #[instrument(err(level = Level::INFO))]
485 /// # use tracing_attributes::instrument;
486 /// #[instrument(err(Debug))]
499 /// # use tracing_attributes::instrument;
500 /// #[instrument(err, ret)]
509 /// # use tracing_attributes::instrument;
510 /// #[instrument]
523 /// # use tracing::instrument;
536 /// #[instrument(fields(value = self.0, tmp = std::any::type_name::<Self>()))]
544 /// # use tracing_attributes::instrument;
545 /// #[instrument]
564 pub fn instrument( in instrument() function
574 /// Instrument the function, without parsing the function body (instead using the raw tokens).
590 /// Instrument the function, by fully parsing the function body,
601 compile_error!("the `#[instrument]` attribute may not be used with `const fn`s") in instrument_precise()
606 // check for async_trait-like patterns in the block, and instrument in instrument_precise()