Skip to main content

msg_debug

Macro msg_debug 

Source
macro_rules! msg_debug {
    ($msg:expr) => { ... };
}
Expand description

Debug-only message display with ๐Ÿ” prefix.

This macro provides debug-specific logging that only appears when debug mode is explicitly enabled. Debug messages are useful for troubleshooting and development but are hidden from normal users to avoid clutter.

ยงDebug-Only Behavior

  • Debug Mode: Messages are displayed using tracing::debug!
  • Normal Mode: Messages are completely suppressed (no output)
  • Performance: No overhead in production builds when debug is disabled

ยงVisual Design

  • Prefix: ๐Ÿ” (magnifying glass emoji)
  • Purpose: Development and troubleshooting information
  • Audience: Developers and power users debugging issues

ยงDebug Message Categories

Debug messages are appropriate for:

  • Technical Details: Low-level system information
  • State Changes: Internal state transitions and updates
  • Performance Metrics: Timing and performance measurements
  • Data Flow: How data moves through the system
  • Error Context: Additional context for debugging errors

ยงUsage Patterns

ยงTechnical Debug Information

use kasl::msg_debug;

let task_id = 42;
msg_debug!(format!("Processing task with ID: {}", task_id));
// Debug mode output: "๐Ÿ” Processing task with ID: 42"
// Normal mode output: (nothing)

ยงState Change Debugging

use kasl::msg_debug;

let old_state = "Active";
let new_state = "InPause";
msg_debug!(format!("State transition: {:?} -> {:?}", old_state, new_state));
// Debug mode output: "๐Ÿ” State transition: Active -> InPause"
// Normal mode output: (nothing)