tracing_init

Macro tracing_init 

Source
macro_rules! tracing_init {
    () => { ... };
    ($name:expr) => { ... };
}
Expand description

Helper macro to initialize the BinaryNinjaLayer tracing layer for plugins.

Maps the current crate name to the provided display name and enables target formatting. Use init_with_layer if you intend on registering a BinaryNinjaLayer with non-default values.

§Note for Plugins

This should only be called once, at the start of plugins.

#[unsafe(no_mangle)]
pub unsafe extern "C" fn CorePluginInit() -> bool {
    binaryninja::tracing_init!("MyPlugin");
    tracing::info!("Core plugin initialized");
    true
}

§Note for Headless

This should never be called if you are running headlessly and as you will likely be registering a LogListener, which will possibly round-trip back to tracing logs and deadlock the program.