chore: reduce log noise by changing frequent commands to debug level
Move high-frequency API read commands from log::info! to log::debug!: - get_artist, get_artist_detail, get_artist_tracks, get_artist_albums - get_featured_albums, get_genres - get_user_playlists, get_playlist, search_playlists - get_favorites, get_tracks_by_ids, get_track_info, get_current_user_id - playlist_get_all_settings, playlist_get_all_stats - playlist_get_all_local_track_counts, get_playlist_folders User action commands (create, delete, add, remove) remain at info level.
This commit is contained in:
1 parent
9b12f761b5
commit
4e80dcf731
4 files changed
+17
-17
No files matched your search
@@ -14,7 +14,7 @@ pub async fn get_favorites(
|
||||
offset: Option<u32>,
|
||||
state: State<'_, AppState>,
|
||||
) -> Result<Value, String> {
|
||||
log::info!("Command: get_favorites type={} limit={:?} offset={:?}", fav_type, limit, offset);
|
||||
log::debug!("Command: get_favorites type={} limit={:?} offset={:?}", fav_type, limit, offset);
|
||||
|
||||
let client = state.client.lock().await;
|
||||
client
|
||||
|
||||
@@ -19,7 +19,7 @@ pub struct TrackInfo {
|
||||
pub async fn get_user_playlists(
|
||||
state: State<'_, AppState>,
|
||||
) -> Result<Vec<Playlist>, String> {
|
||||
log::info!("Command: get_user_playlists");
|
||||
log::debug!("Command: get_user_playlists");
|
||||
|
||||
let client = state.client.lock().await;
|
||||
client
|
||||
@@ -34,7 +34,7 @@ pub async fn get_playlist(
|
||||
playlist_id: u64,
|
||||
state: State<'_, AppState>,
|
||||
) -> Result<Playlist, String> {
|
||||
log::info!("Command: get_playlist {}", playlist_id);
|
||||
log::debug!("Command: get_playlist {}", playlist_id);
|
||||
|
||||
let client = state.client.lock().await;
|
||||
client
|
||||
@@ -51,7 +51,7 @@ pub async fn search_playlists(
|
||||
offset: Option<u32>,
|
||||
state: State<'_, AppState>,
|
||||
) -> Result<SearchResultsPage<Playlist>, String> {
|
||||
log::info!("Command: search_playlists \"{}\" limit={:?} offset={:?}", query, limit, offset);
|
||||
log::debug!("Command: search_playlists \"{}\" limit={:?} offset={:?}", query, limit, offset);
|
||||
|
||||
let client = state.client.lock().await;
|
||||
client
|
||||
@@ -148,7 +148,7 @@ pub async fn get_tracks_by_ids(
|
||||
track_ids: Vec<u64>,
|
||||
state: State<'_, AppState>,
|
||||
) -> Result<Vec<crate::api::models::Track>, String> {
|
||||
log::info!("Command: get_tracks_by_ids ({} tracks)", track_ids.len());
|
||||
log::debug!("Command: get_tracks_by_ids ({} tracks)", track_ids.len());
|
||||
|
||||
let client = state.client.lock().await;
|
||||
let mut tracks = Vec::new();
|
||||
@@ -169,7 +169,7 @@ pub async fn get_tracks_by_ids(
|
||||
/// Get the current user's Qobuz ID
|
||||
#[tauri::command]
|
||||
pub async fn get_current_user_id(state: State<'_, AppState>) -> Result<Option<u64>, String> {
|
||||
log::info!("Command: get_current_user_id");
|
||||
log::debug!("Command: get_current_user_id");
|
||||
|
||||
let client = state.client.lock().await;
|
||||
Ok(client.get_user_id().await)
|
||||
@@ -235,7 +235,7 @@ pub async fn get_track_info(
|
||||
track_id: u64,
|
||||
state: State<'_, AppState>,
|
||||
) -> Result<TrackInfo, String> {
|
||||
log::info!("Command: get_track_info {}", track_id);
|
||||
log::debug!("Command: get_track_info {}", track_id);
|
||||
|
||||
let client = state.client.lock().await;
|
||||
let track = client
|
||||
|
||||
@@ -330,7 +330,7 @@ pub async fn get_featured_albums(
|
||||
genre_id: Option<u64>,
|
||||
state: State<'_, AppState>,
|
||||
) -> Result<SearchResultsPage<Album>, String> {
|
||||
log::info!(
|
||||
log::debug!(
|
||||
"Command: get_featured_albums type={} limit={:?} offset={:?} genre_id={:?}",
|
||||
featured_type,
|
||||
limit,
|
||||
@@ -383,7 +383,7 @@ pub async fn get_artist(
|
||||
state: State<'_, AppState>,
|
||||
cache_state: State<'_, ApiCacheState>,
|
||||
) -> Result<Artist, String> {
|
||||
log::info!("Command: get_artist {}", artist_id);
|
||||
log::debug!("Command: get_artist {}", artist_id);
|
||||
|
||||
// Get current locale
|
||||
let locale = {
|
||||
@@ -428,7 +428,7 @@ pub async fn get_artist_detail(
|
||||
artist_id: u64,
|
||||
state: State<'_, AppState>,
|
||||
) -> Result<Artist, String> {
|
||||
log::info!("Command: get_artist_detail {}", artist_id);
|
||||
log::debug!("Command: get_artist_detail {}", artist_id);
|
||||
|
||||
let client = state.client.lock().await;
|
||||
client
|
||||
@@ -445,7 +445,7 @@ pub async fn get_artist_tracks(
|
||||
offset: Option<u32>,
|
||||
state: State<'_, AppState>,
|
||||
) -> Result<TracksContainer, String> {
|
||||
log::info!(
|
||||
log::debug!(
|
||||
"Command: get_artist_tracks {} limit={:?} offset={:?}",
|
||||
artist_id,
|
||||
limit,
|
||||
@@ -467,7 +467,7 @@ pub async fn get_artist_albums(
|
||||
offset: Option<u32>,
|
||||
state: State<'_, AppState>,
|
||||
) -> Result<ArtistAlbums, String> {
|
||||
log::info!(
|
||||
log::debug!(
|
||||
"Command: get_artist_albums {} limit={:?} offset={:?}",
|
||||
artist_id,
|
||||
limit,
|
||||
@@ -548,7 +548,7 @@ pub async fn get_genres(
|
||||
parent_id: Option<u64>,
|
||||
state: State<'_, AppState>,
|
||||
) -> Result<Vec<crate::api::models::GenreInfo>, String> {
|
||||
log::info!("Command: get_genres parent_id={:?}", parent_id);
|
||||
log::debug!("Command: get_genres parent_id={:?}", parent_id);
|
||||
|
||||
let client = state.client.lock().await;
|
||||
client
|
||||
|
||||
@@ -1352,7 +1352,7 @@ pub async fn playlist_get_local_tracks_with_position(
|
||||
pub async fn playlist_get_all_local_track_counts(
|
||||
state: State<'_, LibraryState>,
|
||||
) -> Result<std::collections::HashMap<u64, u32>, String> {
|
||||
log::info!("Command: playlist_get_all_local_track_counts");
|
||||
log::debug!("Command: playlist_get_all_local_track_counts");
|
||||
|
||||
let db = state.db.lock().await;
|
||||
db.get_all_playlist_local_track_counts()
|
||||
@@ -1377,7 +1377,7 @@ pub async fn playlist_clear_local_tracks(
|
||||
pub async fn playlist_get_all_settings(
|
||||
state: State<'_, LibraryState>,
|
||||
) -> Result<Vec<PlaylistSettings>, String> {
|
||||
log::info!("Command: playlist_get_all_settings");
|
||||
log::debug!("Command: playlist_get_all_settings");
|
||||
|
||||
let db = state.db.lock().await;
|
||||
db.get_all_playlist_settings()
|
||||
@@ -1469,7 +1469,7 @@ pub async fn playlist_get_stats(
|
||||
pub async fn playlist_get_all_stats(
|
||||
state: State<'_, LibraryState>,
|
||||
) -> Result<Vec<PlaylistStats>, String> {
|
||||
log::info!("Command: playlist_get_all_stats");
|
||||
log::debug!("Command: playlist_get_all_stats");
|
||||
|
||||
let db = state.db.lock().await;
|
||||
db.get_all_playlist_stats()
|
||||
@@ -2657,7 +2657,7 @@ pub async fn create_playlist_folder(
|
||||
pub async fn get_playlist_folders(
|
||||
state: State<'_, LibraryState>,
|
||||
) -> Result<Vec<PlaylistFolder>, String> {
|
||||
log::info!("Command: get_playlist_folders");
|
||||
log::debug!("Command: get_playlist_folders");
|
||||
|
||||
let db = state.db.lock().await;
|
||||
db.get_all_playlist_folders().map_err(|e| e.to_string())
|
||||
|
||||
Reference in new issue
Block a user