1
0
Fork 0
forked from wry/wry

Add clean-logs-older-than option

This commit is contained in:
khyperia 2026-03-27 07:44:34 +01:00 committed by Julian Orth
parent 4c7d108e09
commit 880c98ecfb
17 changed files with 360 additions and 10 deletions

View file

@ -3,7 +3,10 @@
//! Note that you can use the `log` crate for logging. All invocations of `log::info` etc.
//! automatically log into the compositors log.
use serde::{Deserialize, Serialize};
use {
serde::{Deserialize, Serialize},
std::time::SystemTime,
};
/// The log level of the compositor or a log message.
#[derive(Serialize, Deserialize, Copy, Clone, Debug)]
@ -19,3 +22,13 @@ pub enum LogLevel {
pub fn set_log_level(level: LogLevel) {
get!().set_log_level(level);
}
/// If this function is called during startup, Jay's log files before `time` are deleted.
///
/// The current log file is never deleted, nor are any other logfiles of active Jay instances (e.g.
/// on another VT), even if `time` is in the future.
///
/// Calling this function after startup has no effect.
pub fn clean_logs_older_than(time: SystemTime) {
get!().clean_logs_older_than(time);
}