Skip to content

Commit

Permalink
Add the env_logger error handling #748 (#749)
Browse files Browse the repository at this point in the history
* Add the env_logger error handling

* Fix clippy warnings
  • Loading branch information
sergeyboyko0791 authored Nov 23, 2020
1 parent 828e55a commit f5c4418
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mm2src/lp_swap/taker_swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

use super::{ban_pubkey, broadcast_my_swap_status, dex_fee_amount, get_locked_amount, get_locked_amount_by_other_swaps,
my_swap_file_path, my_swaps_dir, AtomicSwap, LockedAmount, MySwapInfo, RecoveredSwap, RecoveredSwapAction,
SavedSwap, SwapConfirmationsSettings, SwapError, SwapNegotiationData, SwapsContext, TransactionIdentifier,
BASIC_COMM_TIMEOUT, WAIT_CONFIRM_INTERVAL};
SavedSwap, SwapConfirmationsSettings, SwapError, SwapsContext, TransactionIdentifier,
WAIT_CONFIRM_INTERVAL};
use crate::mm2::lp_network::subscribe_to_topic;
use crate::mm2::lp_swap::{broadcast_swap_message_every, dex_fee_rate, recv_swap_msg, swap_topic, NegotiationDataMsg,
SwapMsg};
Expand Down
4 changes: 3 additions & 1 deletion mm2src/mm2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ mod mm2_tests;
/// * `ctx_cb` - callback used to share the `MmCtx` ID with the call site.
pub fn lp_main(conf: Json, ctx_cb: &dyn Fn(u32)) -> Result<(), String> {
// std::env::set_var("RUST_LOG", "debug");
env_logger::from_env(env_logger::Env::default().default_filter_or("info")).init();
if let Err(e) = env_logger::from_env(env_logger::Env::default().default_filter_or("info")).try_init() {
log!("Env logger initialization failed: "(e))
}
if !conf["rpc_password"].is_null() {
if !conf["rpc_password"].is_string() {
return ERR!("rpc_password must be string");
Expand Down

0 comments on commit f5c4418

Please sign in to comment.