diff --git a/Cargo.toml b/Cargo.toml index 247a98f..0af58d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] downloader_config = { git = "https://github.com/OMGeeky/downloader_config" } -exponential_backoff = { version="0.1.3", git = "https://github.com/OMGeeky/exponential_backoff" } +exponential_backoff = { version="0.2", git = "https://github.com/OMGeeky/exponential_backoff" } google-youtube3 = "5.0.2" @@ -19,8 +19,14 @@ serde_json = "1.0" async-trait = "0.1.60" strfmt = "0.2.2" -log = "0.4.17" +log = "0.4" simplelog = "0.12.1" #[patch.crates-io.yup-oauth2] #path = "../../Documents/GitHub/OMGeeky/yup-oauth2" #version = "7.1.0" + +tracing = { version = "0.1", optional = true } + +[features] +default = [] +tracing = ["dep:tracing","exponential_backoff/tracing", "downloader_config/tracing"] diff --git a/src/lib.rs b/src/lib.rs index 05824a3..f6f41c3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,5 @@ -use log::{debug, error, info, trace, warn}; + +use crate::prelude::*; use std::default::Default; use std::error::Error; use std::path::{Path, PathBuf}; @@ -24,6 +25,7 @@ use youtube::{hyper, hyper_rustls::HttpsConnectorBuilder}; mod auth; pub mod scopes; +pub mod prelude; // mod config; pub struct YoutubeClient { diff --git a/src/main.rs b/src/main.rs index b144e88..7f43a3a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -use log::{debug, error, info, trace, warn}; +use google_youtube::prelude::*; use std::error::Error; use std::path::Path; diff --git a/src/prelude.rs b/src/prelude.rs new file mode 100644 index 0000000..aa693b5 --- /dev/null +++ b/src/prelude.rs @@ -0,0 +1,4 @@ +#[cfg(not(feature = "tracing"))] +pub use log::{debug, error, info, trace, warn}; +#[cfg(feature = "tracing")] +pub use tracing::{debug, error, info, trace, warn};