fix: set tracing instrumentation level to Error

This commit is contained in:
ThetaDev 2024-08-10 00:06:56 +02:00
parent 904f8215d8
commit 9da3b25be2
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6
16 changed files with 35 additions and 35 deletions

View file

@ -632,7 +632,7 @@ impl DownloadQuery {
/// ///
/// If no download path is set, the video is downloaded to the current directory /// If no download path is set, the video is downloaded to the current directory
/// with a filename created by this template: `{track} {title} [{id}]`. /// 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<DownloadResult> { pub async fn download(&self) -> Result<DownloadResult> {
let mut last_err = None; let mut last_err = None;

View file

@ -82,7 +82,7 @@ impl RustyPipeQuery {
} }
/// Get the videos from a YouTube channel /// Get the videos from a YouTube channel
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self), level = "error")]
pub async fn channel_videos<S: AsRef<str> + Debug>( pub async fn channel_videos<S: AsRef<str> + Debug>(
&self, &self,
channel_id: S, channel_id: S,
@ -94,7 +94,7 @@ impl RustyPipeQuery {
/// Get a ordered list of videos from a YouTube channel /// Get a ordered list of videos from a YouTube channel
/// ///
/// This function does not return channel metadata. /// This function does not return channel metadata.
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self), level = "error")]
pub async fn channel_videos_order<S: AsRef<str> + Debug>( pub async fn channel_videos_order<S: AsRef<str> + Debug>(
&self, &self,
channel_id: S, channel_id: S,
@ -105,7 +105,7 @@ impl RustyPipeQuery {
} }
/// Get the videos of the given tab (Shorts, Livestreams) from a YouTube channel /// 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<S: AsRef<str> + Debug>( pub async fn channel_videos_tab<S: AsRef<str> + Debug>(
&self, &self,
channel_id: S, 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 /// Get a ordered list of videos from the given tab (Shorts, Livestreams) of a YouTube channel
/// ///
/// This function does not return channel metadata. /// This function does not return channel metadata.
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self), level = "error")]
pub async fn channel_videos_tab_order<S: AsRef<str> + Debug>( pub async fn channel_videos_tab_order<S: AsRef<str> + Debug>(
&self, &self,
channel_id: S, channel_id: S,
@ -136,7 +136,7 @@ impl RustyPipeQuery {
} }
/// Search the videos of a channel /// Search the videos of a channel
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self), level = "error")]
pub async fn channel_search<S: AsRef<str> + Debug, S2: AsRef<str> + Debug>( pub async fn channel_search<S: AsRef<str> + Debug, S2: AsRef<str> + Debug>(
&self, &self,
channel_id: S, channel_id: S,
@ -152,7 +152,7 @@ impl RustyPipeQuery {
} }
/// Get the playlists of a channel /// Get the playlists of a channel
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self), level = "error")]
pub async fn channel_playlists<S: AsRef<str> + Debug>( pub async fn channel_playlists<S: AsRef<str> + Debug>(
&self, &self,
channel_id: S, channel_id: S,
@ -177,7 +177,7 @@ impl RustyPipeQuery {
} }
/// Get additional metadata from the *About* tab of a channel /// 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<S: AsRef<str> + Debug>( pub async fn channel_info<S: AsRef<str> + Debug>(
&self, &self,
channel_id: S, channel_id: S,

View file

@ -18,7 +18,7 @@ impl RustyPipeQuery {
/// for checking a lot of channels or implementing a subscription feed. /// 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. /// 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<S: AsRef<str> + Debug>( pub async fn channel_rss<S: AsRef<str> + Debug>(
&self, &self,
channel_id: S, channel_id: S,

View file

@ -32,7 +32,7 @@ struct FormData {
impl RustyPipeQuery { impl RustyPipeQuery {
/// Get the YouTube Music charts for a given country /// 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<Country>) -> Result<MusicCharts, Error> { pub async fn music_charts(&self, country: Option<Country>) -> Result<MusicCharts, Error> {
let context = self.get_context(ClientType::DesktopMusic, true, None).await; let context = self.get_context(ClientType::DesktopMusic, true, None).await;
let request_body = QCharts { let request_body = QCharts {

View file

@ -40,7 +40,7 @@ struct QRadio<'a> {
impl RustyPipeQuery { impl RustyPipeQuery {
/// Get the metadata of a YouTube music track /// Get the metadata of a YouTube music track
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self), level = "error")]
pub async fn music_details<S: AsRef<str> + Debug>( pub async fn music_details<S: AsRef<str> + Debug>(
&self, &self,
video_id: S, video_id: S,
@ -68,7 +68,7 @@ impl RustyPipeQuery {
/// Get the lyrics of a YouTube music track /// Get the lyrics of a YouTube music track
/// ///
/// The `lyrics_id` has to be obtained using [`RustyPipeQuery::music_details`]. /// 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<S: AsRef<str> + Debug>(&self, lyrics_id: S) -> Result<Lyrics, Error> { pub async fn music_lyrics<S: AsRef<str> + Debug>(&self, lyrics_id: S) -> Result<Lyrics, Error> {
let lyrics_id = lyrics_id.as_ref(); let lyrics_id = lyrics_id.as_ref();
let context = self.get_context(ClientType::DesktopMusic, true, None).await; 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 /// Get related items (tracks, playlists, artists) to a YouTube Music track
/// ///
/// The `related_id` has to be obtained using [`RustyPipeQuery::music_details`]. /// 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<S: AsRef<str> + Debug>( pub async fn music_related<S: AsRef<str> + Debug>(
&self, &self,
related_id: S, related_id: S,
@ -115,7 +115,7 @@ impl RustyPipeQuery {
/// Get a YouTube Music radio (a dynamically generated playlist) /// 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. /// 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<S: AsRef<str> + Debug>( pub async fn music_radio<S: AsRef<str> + Debug>(
&self, &self,
radio_id: S, radio_id: S,
@ -146,7 +146,7 @@ impl RustyPipeQuery {
} }
/// Get a YouTube Music radio (a dynamically generated playlist) for a track /// 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<S: AsRef<str> + Debug>( pub async fn music_radio_track<S: AsRef<str> + Debug>(
&self, &self,
video_id: S, video_id: S,
@ -156,7 +156,7 @@ impl RustyPipeQuery {
} }
/// Get a YouTube Music radio (a dynamically generated playlist) for a playlist /// 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<S: AsRef<str> + Debug>( pub async fn music_radio_playlist<S: AsRef<str> + Debug>(
&self, &self,
playlist_id: S, playlist_id: S,

View file

@ -13,7 +13,7 @@ use super::{
impl RustyPipeQuery { impl RustyPipeQuery {
/// Get a list of moods and genres from YouTube Music /// 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<Vec<MusicGenreItem>, Error> { pub async fn music_genres(&self) -> Result<Vec<MusicGenreItem>, Error> {
let context = self.get_context(ClientType::DesktopMusic, true, None).await; let context = self.get_context(ClientType::DesktopMusic, true, None).await;
let request_body = QBrowse { let request_body = QBrowse {
@ -32,7 +32,7 @@ impl RustyPipeQuery {
} }
/// Get the playlists from a YouTube Music genre /// Get the playlists from a YouTube Music genre
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self), level = "error")]
pub async fn music_genre<S: AsRef<str> + Debug>( pub async fn music_genre<S: AsRef<str> + Debug>(
&self, &self,
genre_id: S, genre_id: S,

View file

@ -11,7 +11,7 @@ use super::{response, ClientType, MapRespCtx, MapResponse, QBrowse, RustyPipeQue
impl RustyPipeQuery { impl RustyPipeQuery {
/// Get the new albums that were released on YouTube Music /// 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<Vec<AlbumItem>, Error> { pub async fn music_new_albums(&self) -> Result<Vec<AlbumItem>, Error> {
let context = self.get_context(ClientType::DesktopMusic, true, None).await; let context = self.get_context(ClientType::DesktopMusic, true, None).await;
let request_body = QBrowse { let request_body = QBrowse {
@ -30,7 +30,7 @@ impl RustyPipeQuery {
} }
/// Get the new music videos that were released on YouTube Music /// 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<Vec<TrackItem>, Error> { pub async fn music_new_videos(&self) -> Result<Vec<TrackItem>, Error> {
let context = self.get_context(ClientType::DesktopMusic, true, None).await; let context = self.get_context(ClientType::DesktopMusic, true, None).await;
let request_body = QBrowse { let request_body = QBrowse {

View file

@ -22,7 +22,7 @@ use super::{
impl RustyPipeQuery { impl RustyPipeQuery {
/// Get a playlist from YouTube Music /// Get a playlist from YouTube Music
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self), level = "error")]
pub async fn music_playlist<S: AsRef<str> + Debug>( pub async fn music_playlist<S: AsRef<str> + Debug>(
&self, &self,
playlist_id: S, playlist_id: S,
@ -54,7 +54,7 @@ impl RustyPipeQuery {
} }
/// Get an album from YouTube Music /// Get an album from YouTube Music
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self), level = "error")]
pub async fn music_album<S: AsRef<str> + Debug>( pub async fn music_album<S: AsRef<str> + Debug>(
&self, &self,
album_id: S, album_id: S,

View file

@ -126,7 +126,7 @@ impl RustyPipeQuery {
} }
/// Get YouTube Music search suggestions /// Get YouTube Music search suggestions
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self), level = "error")]
pub async fn music_search_suggestion<S: AsRef<str> + Debug>( pub async fn music_search_suggestion<S: AsRef<str> + Debug>(
&self, &self,
query: S, query: S,

View file

@ -14,7 +14,7 @@ use super::{response, ClientType, MapRespCtx, MapResponse, QContinuation, RustyP
impl RustyPipeQuery { impl RustyPipeQuery {
/// Get more YouTube items from the given continuation token and endpoint /// 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<T: FromYtItem, S: AsRef<str> + Debug>( pub async fn continuation<T: FromYtItem, S: AsRef<str> + Debug>(
&self, &self,
ctoken: S, ctoken: S,

View file

@ -113,7 +113,7 @@ impl RustyPipeQuery {
} }
/// Get YouTube player data (video/audio streams + basic metadata) using the specified client /// 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<S: AsRef<str> + Debug>( pub async fn player_from_client<S: AsRef<str> + Debug>(
&self, &self,
video_id: S, video_id: S,

View file

@ -17,7 +17,7 @@ use super::{response, ClientType, MapRespCtx, MapResponse, MapResult, QBrowse, R
impl RustyPipeQuery { impl RustyPipeQuery {
/// Get a YouTube playlist /// Get a YouTube playlist
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self), level = "error")]
pub async fn playlist<S: AsRef<str> + Debug>(&self, playlist_id: S) -> Result<Playlist, Error> { pub async fn playlist<S: AsRef<str> + Debug>(&self, playlist_id: S) -> Result<Playlist, Error> {
let playlist_id = playlist_id.as_ref(); let playlist_id = playlist_id.as_ref();
// YTM playlists require visitor data for continuations to work // YTM playlists require visitor data for continuations to work

View file

@ -24,7 +24,7 @@ struct QSearch<'a> {
impl RustyPipeQuery { impl RustyPipeQuery {
/// Search YouTube /// Search YouTube
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self), level = "error")]
pub async fn search<T: FromYtItem, S: AsRef<str> + Debug>( pub async fn search<T: FromYtItem, S: AsRef<str> + Debug>(
&self, &self,
query: S, query: S,
@ -48,7 +48,7 @@ impl RustyPipeQuery {
} }
/// Search YouTube using the given [`SearchFilter`] /// Search YouTube using the given [`SearchFilter`]
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self), level = "error")]
pub async fn search_filter<T: FromYtItem, S: AsRef<str> + Debug>( pub async fn search_filter<T: FromYtItem, S: AsRef<str> + Debug>(
&self, &self,
query: S, query: S,
@ -73,7 +73,7 @@ impl RustyPipeQuery {
} }
/// Get YouTube search suggestions /// Get YouTube search suggestions
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self), level = "error")]
pub async fn search_suggestion<S: AsRef<str> + Debug>( pub async fn search_suggestion<S: AsRef<str> + Debug>(
&self, &self,
query: S, query: S,

View file

@ -16,7 +16,7 @@ use super::{
impl RustyPipeQuery { impl RustyPipeQuery {
/// Get the videos from the YouTube startpage /// Get the videos from the YouTube startpage
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self), level = "error")]
pub async fn startpage(&self) -> Result<Paginator<VideoItem>, Error> { pub async fn startpage(&self) -> Result<Paginator<VideoItem>, Error> {
let context = self.get_context(ClientType::Desktop, true, None).await; let context = self.get_context(ClientType::Desktop, true, None).await;
let request_body = QBrowse { let request_body = QBrowse {
@ -35,7 +35,7 @@ impl RustyPipeQuery {
} }
/// Get the videos from the YouTube trending page /// Get the videos from the YouTube trending page
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self), level = "error")]
pub async fn trending(&self) -> Result<Vec<VideoItem>, Error> { pub async fn trending(&self) -> Result<Vec<VideoItem>, Error> {
let context = self.get_context(ClientType::Desktop, true, None).await; let context = self.get_context(ClientType::Desktop, true, None).await;
let request_body = QBrowseParams { let request_body = QBrowseParams {

View file

@ -58,7 +58,7 @@ impl RustyPipeQuery {
/// ); /// );
/// # }); /// # });
/// ``` /// ```
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self), level = "error")]
pub async fn resolve_url<S: AsRef<str> + Debug>( pub async fn resolve_url<S: AsRef<str> + Debug>(
self, self,
url: S, url: S,
@ -236,7 +236,7 @@ impl RustyPipeQuery {
/// ); /// );
/// # }); /// # });
/// ``` /// ```
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self), level = "error")]
pub async fn resolve_string<S: AsRef<str> + Debug>( pub async fn resolve_string<S: AsRef<str> + Debug>(
self, self,
s: S, s: S,

View file

@ -31,7 +31,7 @@ struct QVideo<'a> {
impl RustyPipeQuery { impl RustyPipeQuery {
/// Get the metadata for a video /// Get the metadata for a video
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self), level = "error")]
pub async fn video_details<S: AsRef<str> + Debug>( pub async fn video_details<S: AsRef<str> + Debug>(
&self, &self,
video_id: S, 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()` /// 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<S: AsRef<str> + Debug>( pub async fn video_comments<S: AsRef<str> + Debug>(
&self, &self,
ctoken: S, ctoken: S,