Skip to main content

ryo_mutations/debugger/
mod.rs

1//! Debug log insertion and removal for method chains.
2//!
3//! This module provides mutations for inserting trackable debug logs into
4//! method chains, and removing them later. All inserted logs are marked with
5//! session IDs and timestamps, making it easy to:
6//!
7//! - Insert `.inspect(|x| dbg!(x))` between method calls
8//! - Wrap expressions with `dbg!()`
9//! - Insert `println!` statements
10//! - Remove all debug logs from a session
11//! - Remove all ryo-inserted debug logs
12//!
13//! # Example
14//!
15//! ```ignore
16//! use ryo_mutations::debugger::{DebugSession, InsertInspectMutation};
17//!
18//! // Create a session for grouping related debug logs
19//! let session = DebugSession::new();
20//!
21//! // Insert inspect after a specific method
22//! let mutation = InsertInspectMutation::new("iter", session.marker_with_desc("after iter"));
23//!
24//! // Later, remove all logs from this session
25//! let remove = RemoveDebugLogsMutation::by_session(session.id());
26//! ```
27
28mod dbg_wrap;
29mod inspect;
30mod marker;
31mod remover;
32
33pub use dbg_wrap::DbgWrapMutation;
34pub use inspect::InsertInspectMutation;
35pub use marker::{DebugMarker, DebugSession, MARKER_PREFIX};
36pub use remover::{RemovalTarget, RemoveDebugLogsMutation};