1 unstable release
new 0.1.0 | Mar 16, 2025 |
---|
#4 in #subcanister
19KB
182 lines
Module for logging in Internet Computer canisters.
This module provides a logging system for canisters that supports both regular logs
and traces, with JSON formatting and circular buffer storage. It integrates with
the tracing
ecosystem for structured logging.
Example
use bity_dfinity_library::canister_logger::{init, export_logs};
use tracing::info;
// Initialize the logger
init(true); // Enable tracing
// Log some messages
info!("Application started");
tracing::trace!("Detailed trace message");
// Export logs
let logs = export_logs();
Dependencies
~7–15MB
~205K SLoC