mirror of
https://github.com/OMGeeky/google_youtube.git
synced 2025-12-26 16:17:24 +01:00
add feature flag to enable tracing instead of log
This commit is contained in:
10
Cargo.toml
10
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"]
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use log::{debug, error, info, trace, warn};
|
||||
use google_youtube::prelude::*;
|
||||
use std::error::Error;
|
||||
use std::path::Path;
|
||||
|
||||
|
||||
4
src/prelude.rs
Normal file
4
src/prelude.rs
Normal file
@@ -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};
|
||||
Reference in New Issue
Block a user