From 6cbbb373d99d48168529c2f36d2f38962a15d33f Mon Sep 17 00:00:00 2001 From: 223880 Date: Sat, 29 Jun 2024 08:09:28 -0300 Subject: [PATCH] Fix bin --- src/bin/lightning_lendingd.rs | 48 +++++++++++++++++------------------ 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/src/bin/lightning_lendingd.rs b/src/bin/lightning_lendingd.rs index 0d94df1..1f95464 100644 --- a/src/bin/lightning_lendingd.rs +++ b/src/bin/lightning_lendingd.rs @@ -1,40 +1,38 @@ extern crate lightning; extern crate dlc; extern crate nostr; +extern crate log; +extern crate env_logger; -use lightning::{ln::peer_channel::ChannelDetails, util::logger::Logger}; -use dlc::{contract::Contract, payout_curve::PayoutCurve}; -use nostr::{self, NodeClient}; +use lightning::{util::logger::Logger as LightningLogger}; // Renamed to avoid conflict +use dlc::{Contract, PayoutCurve}; // Assuming these are directly available +use nostr::NodeClient; +use log::info; -use crate::lightning_lending::{ - bitcoin::Bitcoin, - nostr::Nostr, - dlc::Dlc, - lightning::Lightning, -}; +struct AppLogger; -struct Logger; - -impl Logger { +impl AppLogger { fn new() -> Self { - Logger + AppLogger } } -fn main() { +fn main() { + env_logger::init(); - env_logger::init(); + info!("Logger initialized"); - info!("Logger initialized"); - - // Assuming these `new` methods exist and accept a logger - let lightning = Lightning::new(&logger); - let bitcoin = Bitcoin::new(&logger); - let dlc = Dlc::new(&logger); - let nostr = Nostr::new(&logger); - let contract = Contract::new(&logger); - let payout_curve = PayoutCurve::new(&logger); - let node_client = NodeClient::new(&logger); + let logger = AppLogger::new(); + // Use logger with your specific implementation + // Assuming new methods accept a reference to AppLogger + let lightning = Lightning::new(&logger); + let bitcoin = Bitcoin::new(&logger); + let dlc = Dlc::new(&logger); + let nostr = Nostr::new(&logger); + let contract = Contract::new(&logger); + let payout_curve = PayoutCurve::new(&logger); + let node_client = NodeClient::new(&logger); } +