fix: update warnings to use log::warn
Co-authored-by: aider (openai/andrew/openrouter/mistralai/mistral-medium-3.1) <aider@aider.chat>
This commit is contained in:
@@ -51,11 +51,11 @@ impl MetaService {
|
||||
}
|
||||
|
||||
if let Err(e) = meta_plugin.configure_outputs(&configured_outputs) {
|
||||
eprintln!("Warning: Failed to configure outputs for meta plugin '{}': {}", plugin_name, e);
|
||||
log::warn!("Warning: Failed to configure outputs for meta plugin '{}': {}", plugin_name, e);
|
||||
}
|
||||
|
||||
if let Err(e) = meta_plugin.configure_options(&configured_options) {
|
||||
eprintln! (
|
||||
log::warn!(
|
||||
"Warning: Failed to configure options for meta plugin '{}': {}",
|
||||
plugin_name, e
|
||||
);
|
||||
@@ -67,8 +67,7 @@ impl MetaService {
|
||||
let original_len = meta_plugins.len();
|
||||
meta_plugins.retain(|meta_plugin| meta_plugin.is_supported());
|
||||
if meta_plugins.len() < original_len {
|
||||
// This is not perfect as it doesn't say which one, but avoids complex logic from save.rs
|
||||
eprintln!("Warning: Some meta plugins are enabled but not supported on this system");
|
||||
log::warn!("Warning: Some meta plugins are enabled but not supported on this system");
|
||||
}
|
||||
|
||||
meta_plugins
|
||||
@@ -82,7 +81,7 @@ impl MetaService {
|
||||
) {
|
||||
// Check for duplicate output names before initializing plugins
|
||||
let mut output_names: std::collections::HashMap<String, Vec<String>> = std::collections::HashMap::new();
|
||||
|
||||
|
||||
for plugin in plugins.iter() {
|
||||
let plugin_name = plugin.meta_name();
|
||||
// For each plugin, collect all the output names it might write to
|
||||
@@ -93,7 +92,7 @@ impl MetaService {
|
||||
serde_yaml::Value::Bool(false) => continue, // This output is disabled
|
||||
_ => internal_name.clone(), // Default to internal name for other types
|
||||
};
|
||||
|
||||
|
||||
// Only track outputs that will actually be written
|
||||
if !matches!(output_config, serde_yaml::Value::Bool(false)) {
|
||||
output_names.entry(output_name)
|
||||
@@ -102,16 +101,16 @@ impl MetaService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Print warnings for duplicate output names
|
||||
for (output_name, plugin_names) in &output_names {
|
||||
if plugin_names.len() > 1 {
|
||||
log::warn!("META_SERVICE: Output name '{}' is provided by multiple plugins: {}",
|
||||
output_name,
|
||||
log::warn!("META_SERVICE: Output name '{}' is provided by multiple plugins: {}",
|
||||
output_name,
|
||||
plugin_names.join(", "));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for meta_plugin in plugins.iter_mut() {
|
||||
if let Err(e) = meta_plugin.initialize(conn, item_id) {
|
||||
log::warn!("META_SERVICE: Failed to initialize meta plugin: {}", e);
|
||||
@@ -133,7 +132,7 @@ impl MetaService {
|
||||
pub fn finalize_plugins(&self, plugins: &mut [Box<dyn MetaPlugin>], conn: &Connection) {
|
||||
for meta_plugin in plugins.iter_mut() {
|
||||
if let Err(e) = meta_plugin.finalize(conn) {
|
||||
eprintln!("Warning: Failed to finalize meta plugin: {}", e);
|
||||
log::warn!("Warning: Failed to finalize meta plugin: {}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user