Skip to main content

format_log_entry

Function format_log_entry 

Source
pub fn format_log_entry(entry: &LogEntry) -> String
Expand description

Format a LogEntry into a human-readable string.

The output format is: [TIMESTAMP] LEVEL: message

§Arguments

§Examples

use cvkg_cli::devtools::{LogEntry, LogLevel, format_log_entry};
let entry = LogEntry {
    timestamp: "2025-01-01T00:00:00Z".to_string(),
    level: LogLevel::Info,
    message: "Application started".to_string(),
};
let formatted = format_log_entry(&entry);
assert_eq!(formatted, "[2025-01-01T00:00:00Z] INFO: Application started");