From 9da3b25be2b2577f7bd0282c09d10d368ac8b73f Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Sat, 10 Aug 2024 00:06:56 +0200 Subject: [PATCH] fix: set tracing instrumentation level to Error --- downloader/src/lib.rs | 2 +- src/client/channel.rs | 14 +++++++------- src/client/channel_rss.rs | 2 +- src/client/music_charts.rs | 2 +- src/client/music_details.rs | 12 ++++++------ src/client/music_genres.rs | 4 ++-- src/client/music_new.rs | 4 ++-- src/client/music_playlist.rs | 4 ++-- src/client/music_search.rs | 2 +- src/client/pagination.rs | 2 +- src/client/player.rs | 2 +- src/client/playlist.rs | 2 +- src/client/search.rs | 6 +++--- src/client/trends.rs | 4 ++-- src/client/url_resolver.rs | 4 ++-- src/client/video_details.rs | 4 ++-- 16 files changed, 35 insertions(+), 35 deletions(-) diff --git a/downloader/src/lib.rs b/downloader/src/lib.rs index d8e22c8..16d93a6 100644 --- a/downloader/src/lib.rs +++ b/downloader/src/lib.rs @@ -632,7 +632,7 @@ impl DownloadQuery { /// /// If no download path is set, the video is downloaded to the current directory /// with a filename created by this template: `{track} {title} [{id}]`. - #[tracing::instrument(skip(self), fields(id = self.video.id))] + #[tracing::instrument(skip(self), level="error", fields(id = self.video.id))] pub async fn download(&self) -> Result { let mut last_err = None; diff --git a/src/client/channel.rs b/src/client/channel.rs index 254a39f..a688ee3 100644 --- a/src/client/channel.rs +++ b/src/client/channel.rs @@ -82,7 +82,7 @@ impl RustyPipeQuery { } /// Get the videos from a YouTube channel - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn channel_videos + Debug>( &self, channel_id: S, @@ -94,7 +94,7 @@ impl RustyPipeQuery { /// Get a ordered list of videos from a YouTube channel /// /// This function does not return channel metadata. - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn channel_videos_order + Debug>( &self, channel_id: S, @@ -105,7 +105,7 @@ impl RustyPipeQuery { } /// Get the videos of the given tab (Shorts, Livestreams) from a YouTube channel - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn channel_videos_tab + Debug>( &self, channel_id: S, @@ -118,7 +118,7 @@ impl RustyPipeQuery { /// Get a ordered list of videos from the given tab (Shorts, Livestreams) of a YouTube channel /// /// This function does not return channel metadata. - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn channel_videos_tab_order + Debug>( &self, channel_id: S, @@ -136,7 +136,7 @@ impl RustyPipeQuery { } /// Search the videos of a channel - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn channel_search + Debug, S2: AsRef + Debug>( &self, channel_id: S, @@ -152,7 +152,7 @@ impl RustyPipeQuery { } /// Get the playlists of a channel - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn channel_playlists + Debug>( &self, channel_id: S, @@ -177,7 +177,7 @@ impl RustyPipeQuery { } /// Get additional metadata from the *About* tab of a channel - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn channel_info + Debug>( &self, channel_id: S, diff --git a/src/client/channel_rss.rs b/src/client/channel_rss.rs index a2f0db3..b28a802 100644 --- a/src/client/channel_rss.rs +++ b/src/client/channel_rss.rs @@ -18,7 +18,7 @@ impl RustyPipeQuery { /// for checking a lot of channels or implementing a subscription feed. /// /// The downside of using the RSS feed is that it does not provide video durations. - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn channel_rss + Debug>( &self, channel_id: S, diff --git a/src/client/music_charts.rs b/src/client/music_charts.rs index 1075913..7ad6149 100644 --- a/src/client/music_charts.rs +++ b/src/client/music_charts.rs @@ -32,7 +32,7 @@ struct FormData { impl RustyPipeQuery { /// Get the YouTube Music charts for a given country - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn music_charts(&self, country: Option) -> Result { let context = self.get_context(ClientType::DesktopMusic, true, None).await; let request_body = QCharts { diff --git a/src/client/music_details.rs b/src/client/music_details.rs index 919b07f..e5ff5f5 100644 --- a/src/client/music_details.rs +++ b/src/client/music_details.rs @@ -40,7 +40,7 @@ struct QRadio<'a> { impl RustyPipeQuery { /// Get the metadata of a YouTube music track - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn music_details + Debug>( &self, video_id: S, @@ -68,7 +68,7 @@ impl RustyPipeQuery { /// Get the lyrics of a YouTube music track /// /// The `lyrics_id` has to be obtained using [`RustyPipeQuery::music_details`]. - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn music_lyrics + Debug>(&self, lyrics_id: S) -> Result { let lyrics_id = lyrics_id.as_ref(); let context = self.get_context(ClientType::DesktopMusic, true, None).await; @@ -90,7 +90,7 @@ impl RustyPipeQuery { /// Get related items (tracks, playlists, artists) to a YouTube Music track /// /// The `related_id` has to be obtained using [`RustyPipeQuery::music_details`]. - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn music_related + Debug>( &self, related_id: S, @@ -115,7 +115,7 @@ impl RustyPipeQuery { /// Get a YouTube Music radio (a dynamically generated playlist) /// /// The `radio_id` can be obtained using [`RustyPipeQuery::music_artist`] to get an artist's radio. - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn music_radio + Debug>( &self, radio_id: S, @@ -146,7 +146,7 @@ impl RustyPipeQuery { } /// Get a YouTube Music radio (a dynamically generated playlist) for a track - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn music_radio_track + Debug>( &self, video_id: S, @@ -156,7 +156,7 @@ impl RustyPipeQuery { } /// Get a YouTube Music radio (a dynamically generated playlist) for a playlist - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn music_radio_playlist + Debug>( &self, playlist_id: S, diff --git a/src/client/music_genres.rs b/src/client/music_genres.rs index 16f3b53..627b93b 100644 --- a/src/client/music_genres.rs +++ b/src/client/music_genres.rs @@ -13,7 +13,7 @@ use super::{ impl RustyPipeQuery { /// Get a list of moods and genres from YouTube Music - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn music_genres(&self) -> Result, Error> { let context = self.get_context(ClientType::DesktopMusic, true, None).await; let request_body = QBrowse { @@ -32,7 +32,7 @@ impl RustyPipeQuery { } /// Get the playlists from a YouTube Music genre - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn music_genre + Debug>( &self, genre_id: S, diff --git a/src/client/music_new.rs b/src/client/music_new.rs index 68251e6..cfc5b6d 100644 --- a/src/client/music_new.rs +++ b/src/client/music_new.rs @@ -11,7 +11,7 @@ use super::{response, ClientType, MapRespCtx, MapResponse, QBrowse, RustyPipeQue impl RustyPipeQuery { /// Get the new albums that were released on YouTube Music - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn music_new_albums(&self) -> Result, Error> { let context = self.get_context(ClientType::DesktopMusic, true, None).await; let request_body = QBrowse { @@ -30,7 +30,7 @@ impl RustyPipeQuery { } /// Get the new music videos that were released on YouTube Music - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn music_new_videos(&self) -> Result, Error> { let context = self.get_context(ClientType::DesktopMusic, true, None).await; let request_body = QBrowse { diff --git a/src/client/music_playlist.rs b/src/client/music_playlist.rs index 8261b2b..0d1ec26 100644 --- a/src/client/music_playlist.rs +++ b/src/client/music_playlist.rs @@ -22,7 +22,7 @@ use super::{ impl RustyPipeQuery { /// Get a playlist from YouTube Music - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn music_playlist + Debug>( &self, playlist_id: S, @@ -54,7 +54,7 @@ impl RustyPipeQuery { } /// Get an album from YouTube Music - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn music_album + Debug>( &self, album_id: S, diff --git a/src/client/music_search.rs b/src/client/music_search.rs index f443229..ea197c7 100644 --- a/src/client/music_search.rs +++ b/src/client/music_search.rs @@ -126,7 +126,7 @@ impl RustyPipeQuery { } /// Get YouTube Music search suggestions - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn music_search_suggestion + Debug>( &self, query: S, diff --git a/src/client/pagination.rs b/src/client/pagination.rs index 94c44e8..1251574 100644 --- a/src/client/pagination.rs +++ b/src/client/pagination.rs @@ -14,7 +14,7 @@ use super::{response, ClientType, MapRespCtx, MapResponse, QContinuation, RustyP impl RustyPipeQuery { /// Get more YouTube items from the given continuation token and endpoint - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn continuation + Debug>( &self, ctoken: S, diff --git a/src/client/player.rs b/src/client/player.rs index b763bb5..2e766e7 100644 --- a/src/client/player.rs +++ b/src/client/player.rs @@ -113,7 +113,7 @@ impl RustyPipeQuery { } /// Get YouTube player data (video/audio streams + basic metadata) using the specified client - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn player_from_client + Debug>( &self, video_id: S, diff --git a/src/client/playlist.rs b/src/client/playlist.rs index ecbf205..1ca0ab3 100644 --- a/src/client/playlist.rs +++ b/src/client/playlist.rs @@ -17,7 +17,7 @@ use super::{response, ClientType, MapRespCtx, MapResponse, MapResult, QBrowse, R impl RustyPipeQuery { /// Get a YouTube playlist - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn playlist + Debug>(&self, playlist_id: S) -> Result { let playlist_id = playlist_id.as_ref(); // YTM playlists require visitor data for continuations to work diff --git a/src/client/search.rs b/src/client/search.rs index 03529f4..50f3b33 100644 --- a/src/client/search.rs +++ b/src/client/search.rs @@ -24,7 +24,7 @@ struct QSearch<'a> { impl RustyPipeQuery { /// Search YouTube - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn search + Debug>( &self, query: S, @@ -48,7 +48,7 @@ impl RustyPipeQuery { } /// Search YouTube using the given [`SearchFilter`] - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn search_filter + Debug>( &self, query: S, @@ -73,7 +73,7 @@ impl RustyPipeQuery { } /// Get YouTube search suggestions - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn search_suggestion + Debug>( &self, query: S, diff --git a/src/client/trends.rs b/src/client/trends.rs index 0a46bc5..a445c91 100644 --- a/src/client/trends.rs +++ b/src/client/trends.rs @@ -16,7 +16,7 @@ use super::{ impl RustyPipeQuery { /// Get the videos from the YouTube startpage - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn startpage(&self) -> Result, Error> { let context = self.get_context(ClientType::Desktop, true, None).await; let request_body = QBrowse { @@ -35,7 +35,7 @@ impl RustyPipeQuery { } /// Get the videos from the YouTube trending page - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn trending(&self) -> Result, Error> { let context = self.get_context(ClientType::Desktop, true, None).await; let request_body = QBrowseParams { diff --git a/src/client/url_resolver.rs b/src/client/url_resolver.rs index ab69903..e771d6e 100644 --- a/src/client/url_resolver.rs +++ b/src/client/url_resolver.rs @@ -58,7 +58,7 @@ impl RustyPipeQuery { /// ); /// # }); /// ``` - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn resolve_url + Debug>( self, url: S, @@ -236,7 +236,7 @@ impl RustyPipeQuery { /// ); /// # }); /// ``` - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn resolve_string + Debug>( self, s: S, diff --git a/src/client/video_details.rs b/src/client/video_details.rs index 1d8a9db..a1fb93e 100644 --- a/src/client/video_details.rs +++ b/src/client/video_details.rs @@ -31,7 +31,7 @@ struct QVideo<'a> { impl RustyPipeQuery { /// Get the metadata for a video - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn video_details + Debug>( &self, video_id: S, @@ -56,7 +56,7 @@ impl RustyPipeQuery { } /// Get the comments for a video using the continuation token obtained from `rusty_pipe_query.video_details()` - #[tracing::instrument(skip(self))] + #[tracing::instrument(skip(self), level = "error")] pub async fn video_comments + Debug>( &self, ctoken: S,