Automatically delete old messages

This commit is contained in:
2024-12-15 00:13:27 +01:00
parent 6d371970f1
commit ed8ec8ca37
7 changed files with 147 additions and 31 deletions

View File

@ -32,13 +32,17 @@ pub struct LogMsg {
}
impl LogMsg {
pub fn new(service: String, message: String, hostname: String) -> Self {
pub fn new(
service: impl Into<String>,
message: impl Into<String>,
hostname: impl Into<String>,
) -> Self {
Self {
time: Some(Local::now()),
severity: Severity::Error,
service,
message,
hostname,
service: service.into(),
message: message.into(),
hostname: hostname.into(),
file: None,
line: None,
}