diff --git a/Cargo.toml b/Cargo.toml index b634ba2..5f63dc0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,4 +18,5 @@ librqbit = {version = "8.1.0", features = ["disable-upload"]} serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" tokio = { version = "1.45", features = ["full"] } +tracing-subscriber = "0.3" url = "2.5.4" diff --git a/README.md b/README.md index 8fbca86..be23ffd 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ aquatic-crawler --infohash-file /path/to/info-hash-ipv4.json\ -d, --debug Debug level - * `e` - error * `i` - info + * `e` - error * `i` - info * `t` - trace (e.g. to run with `RUST_LOG=librqbit=trace`) [default: ei] diff --git a/src/argument.rs b/src/argument.rs index 24fbc57..9cfe13a 100644 --- a/src/argument.rs +++ b/src/argument.rs @@ -7,6 +7,7 @@ pub struct Argument { /// /// * `e` - error /// * `i` - info + /// * `t` - trace (e.g. to run with `RUST_LOG=librqbit=trace`) #[arg(short, long, default_value_t = String::from("ei"))] pub debug: String, diff --git a/src/main.rs b/src/main.rs index 1873f23..9a60e2b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,6 +15,10 @@ async fn main() -> anyhow::Result<()> { let is_debug_i = argument.debug.contains("i"); let is_debug_e = argument.debug.contains("e"); + if argument.debug.contains("t") { + tracing_subscriber::fmt::init() + } + // init shared members let torrent_storage = if let Some(t) = argument.storage { let s = database::torrent::Storage::init(&t, argument.clear)?; @@ -49,10 +53,10 @@ async fn main() -> anyhow::Result<()> { let session = librqbit::Session::new_with_opts( std::path::PathBuf::new(), SessionOptions { - persistence: None, disable_dht: !argument.enable_dht, disable_upload: !argument.enable_upload, enable_upnp_port_forwarding: argument.enable_upnp_port_forwarding, + persistence: None, socks_proxy_url: argument.socks_proxy_url.clone(), trackers: trackers.clone(), ..SessionOptions::default()