Macro logger_warn

macro_rules! logger_warn {
    ($($arg:tt)+) => { ... };
}
Expand description

Captures a log at the warn level, with the given message and attributes.

To attach attributes to a log, pass them with the key = value syntax before the message. The message can be a simple string or a format string with its arguments.

The supported attribute keys are all valid Rust identifiers with up to 8 dots. Using dots will nest multiple attributes under their common prefix in the UI.

The supported attribute values are simple types, such as string, numbers, and boolean.

ยงExamples

use sentry::logger_warn;

// Simple message
logger_warn!("Hello world");

// Message with format args
logger_warn!("Value is {}", 42);

// Message with format args and attributes
logger_warn!(
    error_code = 500,
    user.id = "12345",
    user.email = "test@test.com",
    success = false,
    "Error occurred: {}",
    "bad input"
);