mirror of
https://github.com/OMGeeky/twitch_data.git
synced 2025-12-26 16:27:24 +01:00
add feature flag to enable tracing instead of log
This commit is contained in:
15
Cargo.toml
15
Cargo.toml
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "twitch_data"
|
||||
version = "0.1.8"
|
||||
version = "0.2.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
@@ -14,8 +14,8 @@ reqwest = { version = "0.11", features = ["default", "stream"] }
|
||||
#twitch_api = { version = "0.7.0-rc.3", features = ["helix", "client", "twitch_oauth2", "reqwest"] }
|
||||
tokio = { version = "1.23", features = ["full", "macros"] }
|
||||
twitch_api = { version = "0.7.0-rc.4", features = ["all", "reqwest"] }
|
||||
twitch_types = { version = "0.3.11" , features = ["stream", "timestamp", "default"] }
|
||||
twitch_oauth2 = "0.10.0"
|
||||
twitch_types = { version = "0.4.1", features = ["stream", "timestamp", "default"] }
|
||||
twitch_oauth2 = "0.12.4"
|
||||
|
||||
serde = "1.0.152"
|
||||
serde_json = "1.0.91"
|
||||
@@ -24,5 +24,12 @@ chrono = "0.4"
|
||||
indicatif = "0.17"
|
||||
futures = "0.3"
|
||||
async-recursion = "1.0.0"
|
||||
log = "0.4.17"
|
||||
log = "0.4"
|
||||
simplelog = "0.12.1"
|
||||
|
||||
|
||||
|
||||
tracing = { version = "0.1", optional = true }
|
||||
|
||||
[features]
|
||||
tracing = ["dep:tracing","downloader_config/tracing", "exponential_backoff/tracing"]
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
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