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:
Andrew Phillips
2025-08-26 15:02:31 -03:00
parent 4795a2b2cc
commit f48d7b33b8
3 changed files with 66 additions and 67 deletions

View File

@@ -8,6 +8,7 @@ use std::io::Read;
use std::path::PathBuf;
use std::sync::Arc;
use tokio::sync::Mutex;
use log::warn;
/// An asynchronous wrapper around the `ItemService` for use in async contexts like the web server.
/// It uses `tokio::task::spawn_blocking` to run synchronous database and filesystem operations
@@ -61,7 +62,6 @@ impl AsyncItemService {
.unwrap()
}
pub async fn stream_item_content_by_id(
&self,
item_id: i64,

View File

@@ -9,7 +9,7 @@ use crate::db::{self, Meta};
use crate::compression_engine::{get_compression_engine, CompressionType};
use crate::modes::common::settings_compression_type;
use clap::Command;
use log::debug;
use log::{debug, warn};
use rusqlite::Connection;
use std::collections::HashMap;
use std::fs;

View File

@@ -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
@@ -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);
}
}
}