1
Fork 0
mirror of https://github.com/RGBCube/superfreq synced 2025-07-27 17:07:44 +00:00

core: improve formatting & display for info command

This commit is contained in:
NotAShelf 2025-05-14 02:05:12 +03:00
parent 166dc5a6a5
commit fad56e6e1e
No known key found for this signature in database
GPG key ID: 29D95B64378DB4BF
4 changed files with 457 additions and 80 deletions

View file

@ -69,10 +69,7 @@ pub fn run_daemon(mut config: AppConfig, verbose: bool) -> Result<(), Box<dyn st
Some(path)
} else {
// Check standard config paths
let default_paths = [
"/etc/superfreq/config.toml",
"/etc/superfreq.toml",
];
let default_paths = ["/etc/superfreq/config.toml", "/etc/superfreq.toml"];
default_paths
.iter()
@ -80,24 +77,26 @@ pub fn run_daemon(mut config: AppConfig, verbose: bool) -> Result<(), Box<dyn st
.map(|path| (*path).to_string())
};
let mut config_watcher = if let Some(path) = config_file_path { match ConfigWatcher::new(&path) {
Ok(watcher) => {
log_message(
&effective_log_level,
LogLevel::Info,
&format!("Watching config file: {path}"),
);
Some(watcher)
let mut config_watcher = if let Some(path) = config_file_path {
match ConfigWatcher::new(&path) {
Ok(watcher) => {
log_message(
&effective_log_level,
LogLevel::Info,
&format!("Watching config file: {path}"),
);
Some(watcher)
}
Err(e) => {
log_message(
&effective_log_level,
LogLevel::Warning,
&format!("Failed to initialize config file watcher: {e}"),
);
None
}
}
Err(e) => {
log_message(
&effective_log_level,
LogLevel::Warning,
&format!("Failed to initialize config file watcher: {e}"),
);
None
}
} } else {
} else {
log_message(
&effective_log_level,
LogLevel::Warning,