mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-10-01 01:45:40 -04:00
77fc5743a2
Upgrade bitcoin harness dependency to latest commit Upgrade backoff to fix failing tests. The previous version of backoff had a broken version of the retry function. Upgraded to a newer comit which fixes this problem. Upgrade hyper to 0.14 as the 0.13 was bringing in tokio 0.2.24 Upgraded bitcoin harness to version that uses tokio 1.0 and reqwest 0.11 Upgrade reqwest to 0.11. Reqwest 0.11 uses tokio 1.0 Upgrade libp2p to 0.34 in preparation for tokio 1.0 upgrade
30 lines
862 B
Rust
30 lines
862 B
Rust
use atty::{self};
|
|
use log::LevelFilter;
|
|
use tracing::{info, subscriber};
|
|
use tracing_log::LogTracer;
|
|
use tracing_subscriber::FmtSubscriber;
|
|
|
|
pub fn init_tracing(level: LevelFilter) -> anyhow::Result<()> {
|
|
if level == LevelFilter::Off {
|
|
return Ok(());
|
|
}
|
|
|
|
// We want upstream library log messages, just only at Info level.
|
|
LogTracer::init_with_filter(LevelFilter::Info)?;
|
|
|
|
let is_terminal = atty::is(atty::Stream::Stderr);
|
|
let subscriber = FmtSubscriber::builder()
|
|
.with_env_filter(format!(
|
|
"swap={},monero_harness={},bitcoin_harness={},http=warn,warp=warn",
|
|
level, level, level,
|
|
))
|
|
.with_writer(std::io::stderr)
|
|
.with_ansi(is_terminal)
|
|
.finish();
|
|
|
|
subscriber::set_global_default(subscriber)?;
|
|
info!("Initialized tracing with level: {}", level);
|
|
|
|
Ok(())
|
|
}
|