use crate::identity::CallerId;
use super::times::Timestamp;
#[derive(candid::CandidType, candid::Deserialize, Debug, PartialEq, Clone)]
pub enum LogLevel {
Trace,
Debug,
Info,
Warn,
Error,
}
#[derive(candid::CandidType, candid::Deserialize, Debug, PartialEq, Clone)]
pub struct Log {
pub time: Timestamp, pub level: LogLevel, pub caller: CallerId, pub content: String, }
pub type Logs = Vec<Log>;
pub fn log_insert_with_mut_logs(
logs: &mut Logs,
level: LogLevel,
caller: CallerId,
content: String,
) {
logs.push(Log {
time: super::times::now(),
level,
caller,
content,
});
}