Skip to main content

set_tracker_once

Function set_tracker_once 

Source
pub fn set_tracker_once(tracker: Arc<ProgressTracker>)
Expand description

Sets the global progress tracker for the lifetime of the program.

The tracker is used by library operations (such as crate::LogMatcher::discover_sources and crate::LogMatcher::extract_log_statements) to report progress. If no tracker is registered, those operations run silently.

Call this once at application startup, before invoking any library operations. A second call is silently ignored — the first registration wins.

§Example

use std::sync::Arc;
use log2src::{ProgressTracker, set_tracker_once};

let tracker = Arc::new(ProgressTracker::new());
set_tracker_once(Arc::clone(&tracker));