Fix clippy not linting logging format args

This commit is contained in:
Oliver Hamlet
2025-04-29 17:21:03 +01:00
parent 21d500893a
commit 3553b02644
3 changed files with 10 additions and 4 deletions
+3 -3
View File
@@ -390,7 +390,7 @@ impl Game {
self.cache.set_archive_paths(archive_paths);
logging::trace!("Starting loading {}s.", load_scope);
logging::trace!("Starting loading {load_scope}s.");
let plugins: Vec<_> = plugin_paths
.par_iter()
@@ -462,7 +462,7 @@ impl Game {
if is_log_enabled(LogLevel::Debug) {
logging::debug!("Current load order:");
for plugin_name in plugin_names {
logging::debug!("\t{}", plugin_name);
logging::debug!("\t{plugin_name}");
}
}
@@ -477,7 +477,7 @@ impl Game {
if is_log_enabled(LogLevel::Debug) {
logging::debug!("Sorted load order:");
for plugin_name in &new_load_order {
logging::debug!("\t{}", plugin_name);
logging::debug!("\t{plugin_name}");
}
}
+6
View File
@@ -105,6 +105,7 @@ impl Logger {
}
}
#[clippy::format_args]
macro_rules! log {
($level:expr, $($arg:tt)+) => {
// Log using the Rust log crate, as it's probably good to support that.
@@ -123,22 +124,27 @@ macro_rules! log {
};
}
#[clippy::format_args]
macro_rules! error {
($($arg:tt)+) => { $crate::logging::log!(crate::LogLevel::Error, $($arg)+) };
}
#[clippy::format_args]
macro_rules! warning {
($($arg:tt)+) => { $crate::logging::log!(crate::LogLevel::Warning, $($arg)+) };
}
#[clippy::format_args]
macro_rules! info {
($($arg:tt)+) => { $crate::logging::log!(crate::LogLevel::Info, $($arg)+) };
}
#[clippy::format_args]
macro_rules! debug {
($($arg:tt)+) => { $crate::logging::log!(crate::LogLevel::Debug, $($arg)+) };
}
#[clippy::format_args]
macro_rules! trace {
($($arg:tt)+) => { $crate::logging::log!(crate::LogLevel::Trace, $($arg)+) };
}
+1 -1
View File
@@ -197,7 +197,7 @@ fn find_node_by_weight(
{
Ok(n)
} else {
logging::error!("Can't find group with name {}", weight);
logging::error!("Can't find group with name {weight}");
Err(UndefinedGroupError::new(weight.to_owned()))
}
}