@@ -43,7 +43,7 @@ use crate::routing::scoring::{ChannelUsage, ScoreUpdate, ScoreLookUp};
43
43
use crate :: sync:: RwLock ;
44
44
use crate :: util:: config:: UserConfig ;
45
45
use crate :: util:: test_channel_signer:: { TestChannelSigner , EnforcementState } ;
46
- use crate :: util:: logger:: { Logger , Level , Record } ;
46
+ use crate :: util:: logger:: { Logger , Record } ;
47
47
use crate :: util:: ser:: { Readable , ReadableArgs , Writer , Writeable } ;
48
48
use crate :: util:: persist:: KVStore ;
49
49
@@ -1110,7 +1110,6 @@ impl events::MessageSendEventsProvider for TestRoutingMessageHandler {
1110
1110
}
1111
1111
1112
1112
pub struct TestLogger {
1113
- level : Level ,
1114
1113
pub ( crate ) id : String ,
1115
1114
pub lines : Mutex < HashMap < ( & ' static str , String ) , usize > > ,
1116
1115
pub context : Mutex < HashMap < ( & ' static str , Option < PublicKey > , Option < ChannelId > ) , usize > > ,
@@ -1122,15 +1121,11 @@ impl TestLogger {
1122
1121
}
1123
1122
pub fn with_id ( id : String ) -> TestLogger {
1124
1123
TestLogger {
1125
- level : Level :: Trace ,
1126
1124
id,
1127
1125
lines : Mutex :: new ( new_hash_map ( ) ) ,
1128
1126
context : Mutex :: new ( new_hash_map ( ) ) ,
1129
1127
}
1130
1128
}
1131
- pub fn enable ( & mut self , level : Level ) {
1132
- self . level = level;
1133
- }
1134
1129
pub fn assert_log ( & self , module : & str , line : String , count : usize ) {
1135
1130
let log_entries = self . lines . lock ( ) . unwrap ( ) ;
1136
1131
assert_eq ! ( log_entries. get( & ( module, line) ) , Some ( & count) ) ;
@@ -1174,11 +1169,9 @@ impl Logger for TestLogger {
1174
1169
fn log ( & self , record : Record ) {
1175
1170
* self . lines . lock ( ) . unwrap ( ) . entry ( ( record. module_path , format ! ( "{}" , record. args) ) ) . or_insert ( 0 ) += 1 ;
1176
1171
* self . context . lock ( ) . unwrap ( ) . entry ( ( record. module_path , record. peer_id , record. channel_id ) ) . or_insert ( 0 ) += 1 ;
1177
- if record. level >= self . level {
1178
- #[ cfg( all( not( ldk_bench) , feature = "std" ) ) ] {
1179
- let pfx = format ! ( "{} {} [{}:{}]" , self . id, record. level. to_string( ) , record. module_path, record. line) ;
1180
- println ! ( "{:<55}{}" , pfx, record. args) ;
1181
- }
1172
+ #[ cfg( all( not( ldk_bench) , feature = "std" ) ) ] {
1173
+ let pfx = format ! ( "{} {} [{}:{}]" , self . id, record. level. to_string( ) , record. module_path, record. line) ;
1174
+ println ! ( "{:<55}{}" , pfx, record. args) ;
1182
1175
}
1183
1176
}
1184
1177
}
0 commit comments