thenodes 0.2.0

TheNodes is a modular, plugin-driven P2P node framework for Rust, supporting node-embedded plugins (NEP) and core-as-a-library (CAL) modes with async-first APIs.
Documentation
use crate::events::{
    dispatcher,
    model::{LogEvent, LogLevel, NetworkEvent},
};

/// Emit a structured network event with optional console output suppression.
pub(crate) fn emit_network_event(
    component: &'static str,
    level: LogLevel,
    action: &str,
    addr: Option<String>,
    detail: Option<String>,
    allow_console: bool,
) {
    let mut meta = dispatcher::meta(component, level);
    meta.corr_id = Some(dispatcher::correlation_id());
    if !allow_console {
        meta.suppress_console = true;
    }
    dispatcher::emit(LogEvent::Network(NetworkEvent {
        meta,
        action: action.to_string(),
        addr,
        detail,
    }));
}