🛈 Note: This is pre-release documentation for the upcoming tracing 0.2.0 ecosystem.

For the release documentation, please see docs.rs, instead.

logo
macro_rules! identify_callsite {
    ($callsite:expr) => { ... };
}
Expand description

Statically constructs an Identifier for the provided Callsite.

This may be used in contexts, such as static initializers, where the Metadata::callsite function is not currently usable.

For example:

use tracing_core::{callsite, identify_callsite};
pub struct MyCallsite {
   // ...
}
impl callsite::Callsite for MyCallsite {
    // ...
}

static CALLSITE: MyCallsite = MyCallsite {
    // ...
};

static CALLSITE_ID: callsite::Identifier = identify_callsite!(&CALLSITE);