Skip to main content

msg_warning

Macro msg_warning 

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

Prints a warning message with ⚠️ prefix and automatic routing.

This macro displays warning messages that indicate potential issues or situations requiring user attention, but which don’t prevent operation from continuing. Warnings help users understand system state and make informed decisions.

§Visual Design

  • Prefix: ⚠️ (warning triangle emoji)
  • Purpose: Cautionary messages and non-critical issues
  • Severity: Less critical than errors, more important than info

§Warning Categories

Warnings are appropriate for:

  • Deprecated Features: Features that will be removed in future versions
  • Configuration Issues: Non-critical configuration problems
  • Performance Concerns: Operations that may be slow or inefficient
  • Fallback Behavior: When the system falls back to default behavior
  • Resource Limitations: When approaching resource limits

§Usage Patterns

§Simple Warning Message

use kasl::msg_warning;
use kasl::libs::messages::types::Message;

msg_warning!(Message::AutostartCheckingAlternative);
// Output: "⚠️ Checking alternative autostart methods..."

§Warning Message with Line Breaks

use kasl::msg_warning;
use kasl::libs::messages::types::Message;

msg_warning!(Message::WatcherSignalHandlingNotSupported, true);
// Output: "\n⚠️ Signal handling not supported on this platform\n"