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:
@@ -8,6 +8,7 @@ use std::io::Read;
|
|||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
|
use log::warn;
|
||||||
|
|
||||||
/// An asynchronous wrapper around the `ItemService` for use in async contexts like the web server.
|
/// 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
|
/// It uses `tokio::task::spawn_blocking` to run synchronous database and filesystem operations
|
||||||
@@ -61,7 +62,6 @@ impl AsyncItemService {
|
|||||||
.unwrap()
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pub async fn stream_item_content_by_id(
|
pub async fn stream_item_content_by_id(
|
||||||
&self,
|
&self,
|
||||||
item_id: i64,
|
item_id: i64,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use crate::db::{self, Meta};
|
|||||||
use crate::compression_engine::{get_compression_engine, CompressionType};
|
use crate::compression_engine::{get_compression_engine, CompressionType};
|
||||||
use crate::modes::common::settings_compression_type;
|
use crate::modes::common::settings_compression_type;
|
||||||
use clap::Command;
|
use clap::Command;
|
||||||
use log::debug;
|
use log::{debug, warn};
|
||||||
use rusqlite::Connection;
|
use rusqlite::Connection;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
|||||||
@@ -51,11 +51,11 @@ impl MetaService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let Err(e) = meta_plugin.configure_outputs(&configured_outputs) {
|
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) {
|
if let Err(e) = meta_plugin.configure_options(&configured_options) {
|
||||||
eprintln! (
|
log::warn!(
|
||||||
"Warning: Failed to configure options for meta plugin '{}': {}",
|
"Warning: Failed to configure options for meta plugin '{}': {}",
|
||||||
plugin_name, e
|
plugin_name, e
|
||||||
);
|
);
|
||||||
@@ -67,8 +67,7 @@ impl MetaService {
|
|||||||
let original_len = meta_plugins.len();
|
let original_len = meta_plugins.len();
|
||||||
meta_plugins.retain(|meta_plugin| meta_plugin.is_supported());
|
meta_plugins.retain(|meta_plugin| meta_plugin.is_supported());
|
||||||
if meta_plugins.len() < original_len {
|
if meta_plugins.len() < original_len {
|
||||||
// This is not perfect as it doesn't say which one, but avoids complex logic from save.rs
|
log::warn!("Warning: Some meta plugins are enabled but not supported on this system");
|
||||||
eprintln!("Warning: Some meta plugins are enabled but not supported on this system");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_plugins
|
meta_plugins
|
||||||
@@ -133,7 +132,7 @@ impl MetaService {
|
|||||||
pub fn finalize_plugins(&self, plugins: &mut [Box<dyn MetaPlugin>], conn: &Connection) {
|
pub fn finalize_plugins(&self, plugins: &mut [Box<dyn MetaPlugin>], conn: &Connection) {
|
||||||
for meta_plugin in plugins.iter_mut() {
|
for meta_plugin in plugins.iter_mut() {
|
||||||
if let Err(e) = meta_plugin.finalize(conn) {
|
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