From: Matt Corallo Date: Fri, 17 Aug 2018 01:25:56 +0000 (-0400) Subject: Remove some dead Logger code X-Git-Tag: v0.0.12~349^2~3 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=ebd3bbba0f1d8383861271899f7359bf22a6422f;p=rust-lightning Remove some dead Logger code --- diff --git a/fuzz/fuzz_targets/channel_target.rs b/fuzz/fuzz_targets/channel_target.rs index d5c483f77..38f898c53 100644 --- a/fuzz/fuzz_targets/channel_target.rs +++ b/fuzz/fuzz_targets/channel_target.rs @@ -107,7 +107,7 @@ pub fn do_test(data: &[u8]) { input: &input, }; - let logger: Arc = Arc::new(test_logger::TestLogger::new()); + let logger: Arc = Arc::new(test_logger::TestLogger{}); macro_rules! get_slice { ($len: expr) => { diff --git a/fuzz/fuzz_targets/full_stack_target.rs b/fuzz/fuzz_targets/full_stack_target.rs index 40336124a..e6515b41e 100644 --- a/fuzz/fuzz_targets/full_stack_target.rs +++ b/fuzz/fuzz_targets/full_stack_target.rs @@ -174,7 +174,7 @@ pub fn do_test(data: &[u8]) { Err(_) => return, }; - let logger: Arc = Arc::new(test_logger::TestLogger::new()); + let logger: Arc = Arc::new(test_logger::TestLogger{}); let monitor = Arc::new(TestChannelMonitor{}); let watch = Arc::new(ChainWatchInterfaceUtil::new(Arc::clone(&logger))); let broadcast = Arc::new(TestBroadcaster{}); diff --git a/fuzz/fuzz_targets/router_target.rs b/fuzz/fuzz_targets/router_target.rs index 759e41ff5..2a7e734ec 100644 --- a/fuzz/fuzz_targets/router_target.rs +++ b/fuzz/fuzz_targets/router_target.rs @@ -105,7 +105,7 @@ pub fn do_test(data: &[u8]) { } } - let logger: Arc = Arc::new(test_logger::TestLogger::new()); + let logger: Arc = Arc::new(test_logger::TestLogger{}); let our_pubkey = get_pubkey!(); let router = Router::new(our_pubkey.clone(), Arc::clone(&logger)); diff --git a/fuzz/fuzz_targets/utils/test_logger.rs b/fuzz/fuzz_targets/utils/test_logger.rs index 4446897be..2ef1196b5 100644 --- a/fuzz/fuzz_targets/utils/test_logger.rs +++ b/fuzz/fuzz_targets/utils/test_logger.rs @@ -1,19 +1,6 @@ -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) { diff --git a/src/util/macro_logger.rs b/src/util/macro_logger.rs index 607f8fe4e..d99157491 100644 --- a/src/util/macro_logger.rs +++ b/src/util/macro_logger.rs @@ -1,5 +1,3 @@ -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!()));