Module tracing

Module tracing 

Source
Expand description

Integration with the tracing ecosystem. Send logs to and from Binary Ninja.

This module allows you to use standard Rust tracing macros (like info!, warn!, error!) and have them get sent to Binary Ninja, as well as the other way around with TracingLogListener.

§For Plugins

When writing a plugin, and you want your Rust logs to appear in the Binary Ninja UI, use the crate::tracing_init macro at the start of your plugin’s init function.

§For Headless

When running headless (standalone executables), and you want internal Binary Ninja logs to appear in your terminal’s standard output, register the TracingLogListener after initializing your tracing subscriber.

§Never use both BinaryNinjaLayer and TracingLogListener simultaneously

Enabling both creates an infinite feedback loop where a log triggers a log, deadlocking the application.

Structs§

BinaryNinjaLayer
Subscribes to all spans and events emitted by tracing and forwards them to the core logging API.
TracingLogListener
A LogListener that forwards logs to the registered [Subscriber].

Functions§

init_with_layer
Initialize the core tracing subscriber with the given BinaryNinjaLayer. Collects and sends logs to the core.