alien-core 3.3.35

Deploy software into your customers' cloud accounts and keep it fully managed
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// A recognized application-provided log level.
pub use lognorm::Severity as ApplicationLogLevel;

/// Reads an unambiguous severity using the shared normalization library.
pub fn parse_application_log_level(body: &str) -> Option<ApplicationLogLevel> {
    lognorm::parse(body).severity()
}

/// Projects a readable structured message while callers retain the original.
pub fn parse_application_log_message(body: &str) -> Option<String> {
    let log = lognorm::parse(body);
    (log.outcome() == lognorm::ParseOutcome::Structured && log.message() != body)
        .then(|| log.message().to_owned())
}