typub_log/lib.rs
1//! Logging foundation for typub based on `tracing`.
2//!
3//! This crate provides:
4//! - Re-exported `tracing` macros (`debug!`, `info!`, `warn!`, `error!`)
5//! - A custom `CliLayer` for CLI-formatted output with icons and colors
6//! - The `ProgressReporter` trait for decoupling progress reporting from UI
7//!
8//! Per [[ADR-0004]], this crate is Layer 0 (no internal typub dependencies).
9//!
10//! # Usage
11//!
12//! ```rust,ignore
13//! use typub_log::{debug, info, warn, error};
14//!
15//! // Structured logging with tracing
16//! info!(file = %path.display(), "Processing file");
17//! debug!(count = 42, "Items processed");
18//! warn!(platform = "ghost", "Rate limit approaching");
19//! error!(error = %e, "Upload failed");
20//! ```
21//!
22//! # Initialization
23//!
24//! Call `init()` at CLI startup to install the CLI subscriber:
25//!
26//! ```rust,ignore
27//! typub_log::init(verbose);
28//! ```
29
30mod cli_layer;
31mod progress;
32
33pub use cli_layer::{CliLayer, init, is_verbose};
34pub use progress::{FnReporter, NullReporter, ProgressReporter};
35
36// Re-export tracing macros for convenient use
37pub use tracing::{debug, error, info, trace, warn};
38
39// Re-export tracing types for advanced use
40pub use tracing::{Level, Span, span};