Module prelude

Module prelude 

Source
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.
imetric
Records a integer metric.
info
Logs a message at the info level.
instrument_named
Instruments a future with a named span. Usage: instrument_named!(future, "span_name")
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_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 still needs to be statically allocated.
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§

DualTime
InstrumentedFuture
A wrapper that instruments a future with async span tracing
InstrumentedNamedFuture
A wrapper that instruments a future with named async span tracing
ParseLevelError
ProcessInfo
SpanContextFuture
A future wrapper that establishes a span context on every poll.

Enums§

Level
An enum representing the verbosity levels for logging.
LevelFilter
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§

InstrumentFuture
Trait for adding instrumentation to futures
TracingRuntimeExt
Extension trait for tokio::runtime::Builder that 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.

Attribute Macros§

log_fn
Logs function entry with the function name.
span_fn
Instruments a function with automatic span tracing.