1818
1919use  std:: { collections:: HashMap ,  fmt:: Debug ,  hash} ; 
2020
21+ use  crate :: LOG_TARGET ; 
2122use  linked_hash_map:: LinkedHashMap ; 
2223use  log:: { debug,  trace} ; 
2324use  serde:: Serialize ; 
@@ -67,13 +68,13 @@ impl<H: hash::Hash + traits::Member + Serialize, C: ChainApi> Listener<H, C> {
6768
6869	/// Notify the listeners about extrinsic broadcast. 
6970pub  fn  broadcasted ( & mut  self ,  hash :  & H ,  peers :  Vec < String > )  { 
70- 		trace ! ( target:  "txpool" ,  "[{:?}] Broadcasted" ,  hash) ; 
71+ 		trace ! ( target:  LOG_TARGET ,  "[{:?}] Broadcasted" ,  hash) ; 
7172		self . fire ( hash,  |watcher| watcher. broadcast ( peers) ) ; 
7273	} 
7374
7475	/// New transaction was added to the ready pool or promoted from the future pool. 
7576pub  fn  ready ( & mut  self ,  tx :  & H ,  old :  Option < & H > )  { 
76- 		trace ! ( target:  "txpool" ,  "[{:?}] Ready (replaced with {:?})" ,  tx,  old) ; 
77+ 		trace ! ( target:  LOG_TARGET ,  "[{:?}] Ready (replaced with {:?})" ,  tx,  old) ; 
7778		self . fire ( tx,  |watcher| watcher. ready ( ) ) ; 
7879		if  let  Some ( old)  = old { 
7980			self . fire ( old,  |watcher| watcher. usurped ( tx. clone ( ) ) ) ; 
@@ -82,13 +83,13 @@ impl<H: hash::Hash + traits::Member + Serialize, C: ChainApi> Listener<H, C> {
8283
8384	/// New transaction was added to the future pool. 
8485pub  fn  future ( & mut  self ,  tx :  & H )  { 
85- 		trace ! ( target:  "txpool" ,  "[{:?}] Future" ,  tx) ; 
86+ 		trace ! ( target:  LOG_TARGET ,  "[{:?}] Future" ,  tx) ; 
8687		self . fire ( tx,  |watcher| watcher. future ( ) ) ; 
8788	} 
8889
8990	/// Transaction was dropped from the pool because of the limit. 
9091pub  fn  dropped ( & mut  self ,  tx :  & H ,  by :  Option < & H > )  { 
91- 		trace ! ( target:  "txpool" ,  "[{:?}] Dropped (replaced with {:?})" ,  tx,  by) ; 
92+ 		trace ! ( target:  LOG_TARGET ,  "[{:?}] Dropped (replaced with {:?})" ,  tx,  by) ; 
9293		self . fire ( tx,  |watcher| match  by { 
9394			Some ( t)  => watcher. usurped ( t. clone ( ) ) , 
9495			None  => watcher. dropped ( ) , 
@@ -97,13 +98,13 @@ impl<H: hash::Hash + traits::Member + Serialize, C: ChainApi> Listener<H, C> {
9798
9899	/// Transaction was removed as invalid. 
99100pub  fn  invalid ( & mut  self ,  tx :  & H )  { 
100- 		debug ! ( target:  "txpool" ,  "[{:?}] Extrinsic invalid" ,  tx) ; 
101+ 		debug ! ( target:  LOG_TARGET ,  "[{:?}] Extrinsic invalid" ,  tx) ; 
101102		self . fire ( tx,  |watcher| watcher. invalid ( ) ) ; 
102103	} 
103104
104105	/// Transaction was pruned from the pool. 
105106pub  fn  pruned ( & mut  self ,  block_hash :  BlockHash < C > ,  tx :  & H )  { 
106- 		debug ! ( target:  "txpool" ,  "[{:?}] Pruned at {:?}" ,  tx,  block_hash) ; 
107+ 		debug ! ( target:  LOG_TARGET ,  "[{:?}] Pruned at {:?}" ,  tx,  block_hash) ; 
107108		// Get the transactions included in the given block hash. 
108109		let  txs = self . finality_watchers . entry ( block_hash) . or_insert ( vec ! [ ] ) ; 
109110		txs. push ( tx. clone ( ) ) ; 
@@ -134,7 +135,12 @@ impl<H: hash::Hash + traits::Member + Serialize, C: ChainApi> Listener<H, C> {
134135pub  fn  finalized ( & mut  self ,  block_hash :  BlockHash < C > )  { 
135136		if  let  Some ( hashes)  = self . finality_watchers . remove ( & block_hash)  { 
136137			for  ( tx_index,  hash)  in  hashes. into_iter ( ) . enumerate ( )  { 
137- 				log:: debug!( target:  "txpool" ,  "[{:?}] Sent finalization event (block {:?})" ,  hash,  block_hash) ; 
138+ 				log:: debug!( 
139+ 					target:  LOG_TARGET , 
140+ 					"[{:?}] Sent finalization event (block {:?})" , 
141+ 					hash, 
142+ 					block_hash, 
143+ 				) ; 
138144				self . fire ( & hash,  |watcher| watcher. finalized ( block_hash,  tx_index) ) 
139145			} 
140146		} 
0 commit comments