add feature flag to enable tracing instead of log

This commit is contained in:
OMGeeky
2023-06-01 22:11:51 +02:00
parent 61762208ad
commit e369535b23
4 changed files with 18 additions and 7 deletions

View File

@@ -12,7 +12,7 @@ use exponential_backoff::twitch::{
check_backoff_twitch_with_client,
};
use futures::future::join_all;
use log::{debug, error, info, trace, warn};
use crate::prelude::*;
use reqwest;
use serde::{Deserialize, Serialize};
use tokio::fs::File;
@@ -25,7 +25,7 @@ use twitch_api::helix::videos::Video as TwitchVideo;
use twitch_api::types::{Timestamp, VideoPrivacy};
use twitch_oauth2::{ClientId, ClientSecret};
pub use twitch_types::{UserId, VideoId};
pub mod prelude;
//region DownloadError
#[derive(Debug, Clone)]
pub struct DownloadError {

View File

@@ -1,4 +1,4 @@
use log::info;
use twitch_data::prelude::info;
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};