input: &input,
};
- let logger: Arc<Logger> = Arc::new(test_logger::TestLogger::new());
+ let logger: Arc<Logger> = Arc::new(test_logger::TestLogger{});
macro_rules! get_slice {
($len: expr) => {
Err(_) => return,
};
- let logger: Arc<Logger> = Arc::new(test_logger::TestLogger::new());
+ let logger: Arc<Logger> = Arc::new(test_logger::TestLogger{});
let monitor = Arc::new(TestChannelMonitor{});
let watch = Arc::new(ChainWatchInterfaceUtil::new(Arc::clone(&logger)));
let broadcast = Arc::new(TestBroadcaster{});
}
}
- let logger: Arc<Logger> = Arc::new(test_logger::TestLogger::new());
+ let logger: Arc<Logger> = Arc::new(test_logger::TestLogger{});
let our_pubkey = get_pubkey!();
let router = Router::new(our_pubkey.clone(), Arc::clone(&logger));
-use lightning::util::logger::{Logger, Level, Record};
+use lightning::util::logger::{Logger, Record};
-pub struct TestLogger {
- level: Level,
-}
-
-impl TestLogger {
- pub fn new() -> TestLogger {
- TestLogger {
- level: Level::Off,
- }
- }
- pub fn enable(&mut self, level: Level) {
- self.level = level;
- }
-}
+pub struct TestLogger {}
impl Logger for TestLogger {
fn log(&self, record: &Record) {
-use util::logger::Record;
-
macro_rules! log_internal {
($self: ident, $lvl:expr, $($arg:tt)+) => (
&$self.logger.log(&Record::new($lvl, format_args!($($arg)+), module_path!(), file!(), line!()));