mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-02-02 02:25:00 -05:00
Remove redundant noun from tracing initialiser functions
This commit is contained in:
parent
9745d150e7
commit
8805002f96
@ -1,6 +1,6 @@
|
||||
pub mod command;
|
||||
pub mod config;
|
||||
mod rate;
|
||||
pub mod trace;
|
||||
pub mod tracing;
|
||||
|
||||
pub use rate::Rate;
|
||||
|
@ -2,7 +2,7 @@ use anyhow::Result;
|
||||
use tracing_subscriber::filter::LevelFilter;
|
||||
use tracing_subscriber::FmtSubscriber;
|
||||
|
||||
pub fn init_tracing(level: LevelFilter) -> Result<()> {
|
||||
pub fn init(level: LevelFilter) -> Result<()> {
|
||||
if level == LevelFilter::OFF {
|
||||
return Ok(());
|
||||
}
|
@ -21,7 +21,6 @@ use swap::asb::command::{Arguments, Command};
|
||||
use swap::asb::config::{
|
||||
initial_setup, query_user_for_initial_testnet_config, read_config, Config, ConfigNotInitialized,
|
||||
};
|
||||
use swap::asb::trace::init_tracing;
|
||||
use swap::database::Database;
|
||||
use swap::env::GetConfig;
|
||||
use swap::fs::default_config_path;
|
||||
@ -30,7 +29,7 @@ use swap::network::swarm;
|
||||
use swap::protocol::alice::event_loop::KrakenRate;
|
||||
use swap::protocol::alice::{run, Behaviour, EventLoop};
|
||||
use swap::seed::Seed;
|
||||
use swap::{bitcoin, env, kraken, monero};
|
||||
use swap::{asb, bitcoin, env, kraken, monero};
|
||||
use tracing::{info, warn};
|
||||
use tracing_subscriber::filter::LevelFilter;
|
||||
|
||||
@ -41,7 +40,7 @@ const DEFAULT_WALLET_NAME: &str = "asb-wallet";
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
init_tracing(LevelFilter::DEBUG).expect("initialize tracing");
|
||||
asb::tracing::init(LevelFilter::DEBUG).expect("initialize tracing");
|
||||
|
||||
let opt = Arguments::from_args();
|
||||
|
||||
|
@ -22,7 +22,6 @@ use std::time::Duration;
|
||||
use structopt::StructOpt;
|
||||
use swap::bitcoin::{Amount, TxLock};
|
||||
use swap::cli::command::{Arguments, Command, MoneroParams};
|
||||
use swap::cli::trace::init_tracing;
|
||||
use swap::database::Database;
|
||||
use swap::env::{Config, GetConfig};
|
||||
use swap::network::quote::BidQuote;
|
||||
@ -30,7 +29,7 @@ use swap::network::swarm;
|
||||
use swap::protocol::bob;
|
||||
use swap::protocol::bob::{Behaviour, Builder, EventLoop};
|
||||
use swap::seed::Seed;
|
||||
use swap::{bitcoin, env, monero};
|
||||
use swap::{bitcoin, cli, env, monero};
|
||||
use tracing::{debug, error, info, warn};
|
||||
use url::Url;
|
||||
use uuid::Uuid;
|
||||
@ -56,7 +55,7 @@ async fn main() -> Result<()> {
|
||||
let swap_id = Uuid::new_v4();
|
||||
|
||||
let data_dir = data.0;
|
||||
init_tracing(debug, data_dir.join("logs"), swap_id)?;
|
||||
cli::tracing::init(debug, data_dir.join("logs"), swap_id)?;
|
||||
let db = Database::open(data_dir.join("database").as_path())
|
||||
.context("Failed to open database")?;
|
||||
let seed = Seed::from_file_or_generate(data_dir.as_path())
|
||||
@ -153,7 +152,7 @@ async fn main() -> Result<()> {
|
||||
electrum_rpc_url,
|
||||
} => {
|
||||
let data_dir = data.0;
|
||||
init_tracing(debug, data_dir.join("logs"), swap_id)?;
|
||||
cli::tracing::init(debug, data_dir.join("logs"), swap_id)?;
|
||||
let db = Database::open(data_dir.join("database").as_path())
|
||||
.context("Failed to open database")?;
|
||||
let seed = Seed::from_file_or_generate(data_dir.as_path())
|
||||
@ -204,7 +203,7 @@ async fn main() -> Result<()> {
|
||||
electrum_rpc_url,
|
||||
} => {
|
||||
let data_dir = data.0;
|
||||
init_tracing(debug, data_dir.join("logs"), swap_id)?;
|
||||
cli::tracing::init(debug, data_dir.join("logs"), swap_id)?;
|
||||
let db = Database::open(data_dir.join("database").as_path())
|
||||
.context("Failed to open database")?;
|
||||
let seed = Seed::from_file_or_generate(data_dir.as_path())
|
||||
@ -234,7 +233,7 @@ async fn main() -> Result<()> {
|
||||
electrum_rpc_url,
|
||||
} => {
|
||||
let data_dir = data.0;
|
||||
init_tracing(debug, data_dir.join("logs"), swap_id)?;
|
||||
cli::tracing::init(debug, data_dir.join("logs"), swap_id)?;
|
||||
let db = Database::open(data_dir.join("database").as_path())
|
||||
.context("Failed to open database")?;
|
||||
let seed = Seed::from_file_or_generate(data_dir.as_path())
|
||||
|
@ -1,2 +1,2 @@
|
||||
pub mod command;
|
||||
pub mod trace;
|
||||
pub mod tracing;
|
||||
|
@ -8,7 +8,7 @@ use tracing_subscriber::layer::{Context, SubscriberExt};
|
||||
use tracing_subscriber::{fmt, EnvFilter, Layer, Registry};
|
||||
use uuid::Uuid;
|
||||
|
||||
pub fn init_tracing(debug: bool, dir: impl AsRef<Path>, swap_id: Uuid) -> Result<()> {
|
||||
pub fn init(debug: bool, dir: impl AsRef<Path>, swap_id: Uuid) -> Result<()> {
|
||||
let level_filter = EnvFilter::try_new("swap=debug")?;
|
||||
|
||||
let registry = Registry::default().with(level_filter);
|
Loading…
x
Reference in New Issue
Block a user