Expand description
Commonly used items for convenient importing - includes macros, types, and traits
Macros§
- debug
- Logs a message at the debug level.
- error
- Logs a message at the error level.
- fatal
- Logs a message representing a crash or panic
- fmetric
- Records a float metric.
- fmetric_
dyn - Records a float metric whose name or unit is only known at run time.
- imetric
- Records a integer metric. Use [
imetric_dyn!] when the name or unit is built at run time. - imetric_
dyn - Records an integer metric whose name or unit is only known at run time.
- info
- Logs a message at the info level.
- instrument_
named - Instruments a future with a named span.
Usage:
instrument_named!(future, "span_name") - instrument_
named_ dyn - Instruments a future with a named span whose name is built at runtime.
The future owns the name: pass a
StringorArc<str>to keep the future'static. Usage:instrument_named_dyn!(future, format!("op {id}")) - log
- The standard logging macro.
- log_
enabled - Determines if a message logged at the specified level in that module will be logged.
- span_
async_ named - Instruments an async block with a named span using a static string. This creates both the SpanLocation and instruments the future in one macro call.
- span_
async_ named_ dyn - Instruments an async block with a named span whose name is built at runtime.
The future owns the name: pass a
StringorArc<str>to keep the future'static. - span_
scope - Records a sync span as two thread events
- span_
scope_ named - Records a span with a name that is determined at runtime.
The span name needs to be statically allocated; use
span_scope_named_dyn!for a name built at runtime. - span_
scope_ named_ dyn - Records a span whose name is built at runtime, such as
format!(..)or a&String. The name is copied into each block that records one of the span’s events, so a high number of distinct names does not accumulate in memory. The guard owns the name, which is kept alive until the end of the scope. - static_
span_ desc - static_
span_ location - Creates a static SpanLocation for use with named async spans.
This is an internal implementation detail - users should use
instrument_named!instead. - trace
- Logs a message at the trace level.
- warn
- Logs a message at the warn level.
Structs§
- Dual
Time - DynProperty
- A property whose value is not
'static. The name is either'static(new, referenced by address) or block-scoped (with_dyn_name, copied into the block like a dynamic value). Names from outside Rust, or otherwise unbounded, belong inwith_dyn_name. - Instrumented
Future - A wrapper that instruments a future with async span tracing
- Instrumented
Named Future - A wrapper that instruments a future with named async span tracing
- Parse
Level Error - Process
Info - Span
Context Future - A future wrapper that establishes a span context on every poll.
Enums§
- Level
- An enum representing the verbosity levels for logging.
- Level
Filter - An enum representing the available verbosity level filters of the logger.
- LodFilter
- An enum representing the available verbosity level filters of the logger.
- Verbosity
- An enum representing the level of verbosity for
metrics/thread_spans/spans.
Constants§
- STATIC_
MAX_ LEVEL - The statically resolved maximum log level.
- STATIC_
MAX_ LOD - The statically resolved maximum metrics/spans lod.
Traits§
- Instrument
Future - Trait for adding instrumentation to futures
- Tracing
Runtime Ext - Extension trait for
tokio::runtime::Builderthat adds tracing lifecycle callbacks.
Functions§
- current_
span_ id - Returns the current span ID from the async call stack. Returns 0 (root) if no span is active.
- frequency
- max_
level - Returns the current maximum log level.
- max_lod
- Returns the current maximum log level.
- now
- set_
max_ level - Sets the global maximum log level.
- set_
max_ lod - Sets the global maximum log level.
- spawn_
with_ context - Spawns a future on the tokio runtime while preserving the current span context.