add feature flag to enable tracing instead of log

This commit is contained in:
OMGeeky
2023-06-01 21:45:13 +02:00
parent 1b9f6635e2
commit 817f36742d
4 changed files with 16 additions and 4 deletions

View File

@@ -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 {

View File

@@ -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
View 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};