Skip to content

Commit fecba05

Browse files
author
Seulgi Kim
committed
Adjust log levels
1 parent 5119062 commit fecba05

File tree

9 files changed

+24
-24
lines changed

9 files changed

+24
-24
lines changed

core/src/blockchain/blockchain.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl BlockChain {
134134
ctrace!(BLOCKCHAIN, "Inserting block #{}({}) to the blockchain.", new_header.number(), new_block_hash);
135135

136136
if self.is_known(&new_block_hash) {
137-
ctrace!(BLOCKCHAIN, "Block #{}({}) is already known.", new_header.number(), new_block_hash);
137+
cdebug!(BLOCKCHAIN, "Block #{}({}) is already known.", new_header.number(), new_block_hash);
138138
return ImportRoute::none()
139139
}
140140

@@ -194,7 +194,7 @@ impl BlockChain {
194194
if parent_details_of_new_block.total_score + new_header.score() > self.best_proposal_block_detail().total_score
195195
&& engine.can_change_canon_chain(&new_header)
196196
{
197-
ctrace!(
197+
cinfo!(
198198
BLOCKCHAIN,
199199
"Block #{}({}) has higher total score, changing the best proposal/canonical chain.",
200200
new_header.number(),

core/src/client/client.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ impl EngineClient for Client {
536536
match self.io_channel.lock().send(ClientIoMessage::UpdateBestAsCommitted(block_hash)) {
537537
Ok(_) => {}
538538
Err(e) => {
539-
cdebug!(CLIENT, "Error while triggering the best block update: {}", e);
539+
cerror!(CLIENT, "Error while triggering the best block update: {}", e);
540540
}
541541
}
542542
}
@@ -618,15 +618,15 @@ impl BlockChainClient for Client {
618618
let queue_size = self.queue_transactions.load(AtomicOrdering::Relaxed);
619619
ctrace!(EXTERNAL_PARCEL, "Queue size: {}", queue_size);
620620
if queue_size > MAX_MEM_POOL_SIZE {
621-
debug!("Ignoring {} transactions: queue is full", transactions.len());
621+
cwarn!(EXTERNAL_PARCEL, "Ignoring {} transactions: queue is full", transactions.len());
622622
} else {
623623
let len = transactions.len();
624624
match self.io_channel.lock().send(ClientIoMessage::NewTransactions(transactions, peer_id)) {
625625
Ok(_) => {
626626
self.queue_transactions.fetch_add(len, AtomicOrdering::SeqCst);
627627
}
628628
Err(e) => {
629-
debug!("Ignoring {} transactions: error queueing: {}", len, e);
629+
cwarn!(EXTERNAL_PARCEL, "Ignoring {} transactions: error queueing: {}", len, e);
630630
}
631631
}
632632
}
@@ -793,7 +793,7 @@ impl ImportSealedBlock for Client {
793793
let header = block.header().clone();
794794

795795
let route = self.importer.commit_block(block, &header, &block_data, self);
796-
ctrace!(CLIENT, "Imported sealed block #{} ({})", number, h);
796+
cinfo!(CLIENT, "Imported sealed block #{} ({})", number, h);
797797
route
798798
};
799799
let (enacted, retracted) = self.importer.calculate_enacted_retracted(&[route]);

core/src/client/importer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ impl Importer {
381381
ctrace!(CLIENT, "Importing header {}", header.number());
382382

383383
if bad.contains(&hash) || bad.contains(header.parent_hash()) {
384-
ctrace!(CLIENT, "Bad header detected : {}", hash);
384+
cinfo!(CLIENT, "Bad header detected : {}", hash);
385385
bad.insert(hash);
386386
continue
387387
}

core/src/consensus/signer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl EngineSigner {
4949
self.account_provider = ap;
5050
self.signer = Some((address, public));
5151
self.decrypted_account = None;
52-
cdebug!(ENGINE, "Setting Engine signer to {}", address);
52+
cinfo!(ENGINE, "Setting Engine signer to {}", address);
5353
}
5454

5555
// TODO: remove decrypted_account after some timeout
@@ -61,7 +61,7 @@ impl EngineSigner {
6161
self.account_provider = ap;
6262
self.signer = Some((address, public));
6363
self.decrypted_account = Some(account);
64-
cdebug!(ENGINE, "Setting Engine signer to {} (retaining)", address);
64+
cinfo!(ENGINE, "Setting Engine signer to {} (retaining)", address);
6565
}
6666

6767
/// Sign a consensus message hash.

core/src/consensus/tendermint/worker.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ impl Worker {
198198
match msg {
199199
Ok((extension, client)) => (extension, client),
200200
Err(crossbeam::RecvError) => {
201-
cwarn!(ENGINE, "The tendermint extension is not initalized.");
201+
cerror!(ENGINE, "The tendermint extension is not initalized.");
202202
return
203203
}
204204
}
@@ -207,7 +207,7 @@ impl Worker {
207207
match msg {
208208
Ok(()) => {},
209209
Err(crossbeam::RecvError) => {
210-
cwarn!(ENGINE, "The quit channel for tendermint thread had been closed.");
210+
cerror!(ENGINE, "The quit channel for tendermint thread had been closed.");
211211
}
212212
}
213213
return
@@ -323,7 +323,7 @@ impl Worker {
323323
inner.get_all_votes_and_authors(&vote_step, &requested, result);
324324
}
325325
Err(crossbeam::RecvError) => {
326-
cwarn!(ENGINE, "The event channel for tendermint thread had been closed.");
326+
cerror!(ENGINE, "The event channel for tendermint thread had been closed.");
327327
break
328328
}
329329
}
@@ -332,7 +332,7 @@ impl Worker {
332332
match msg {
333333
Ok(()) => {},
334334
Err(crossbeam::RecvError) => {
335-
cwarn!(ENGINE, "The quit channel for tendermint thread had been closed.");
335+
cerror!(ENGINE, "The quit channel for tendermint thread had been closed.");
336336
}
337337
}
338338
break

core/src/consensus/vote_collector.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ impl<M: Message + Default + Encodable + Debug> VoteCollector<M> {
120120

121121
let is_known = read_guard.get(&message.round()).map_or(false, |c| c.messages.contains(message));
122122
if is_known {
123-
ctrace!(ENGINE, "Known message: {:?}.", message);
123+
cdebug!(ENGINE, "Known message: {:?}.", message);
124124
return true
125125
}
126126

127127
// The reason not using `message.round() <= oldest` is to allow precommit messages on Commit step.
128128
let is_old = read_guard.keys().next().map_or(true, |oldest| message.round() < oldest);
129129
if is_old {
130-
ctrace!(ENGINE, "Old message {:?}.", message);
130+
cdebug!(ENGINE, "Old message {:?}.", message);
131131
return true
132132
}
133133

core/src/miner/miner.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,15 @@ impl Miner {
237237
);
238238

239239
if should_disable_sealing {
240-
ctrace!(MINER, "Miner sleeping");
240+
cdebug!(MINER, "Miner sleeping");
241241
sealing_work.enabled = false;
242242
sealing_work.queue.reset();
243243
false
244244
} else {
245245
true
246246
}
247247
} else {
248-
ctrace!(MINER, "requires_reseal: sealing is disabled");
248+
cdebug!(MINER, "requires_reseal: sealing is disabled");
249249
false
250250
}
251251
}
@@ -500,7 +500,7 @@ impl Miner {
500500
Err(e) => {
501501
invald_tx_users.insert(signer_public);
502502
invalid_transactions.push(hash);
503-
cdebug!(
503+
cinfo!(
504504
MINER,
505505
"Error adding transaction to block: number={}. tx_hash={:?}, Error: {:?}",
506506
block_number,
@@ -515,7 +515,7 @@ impl Miner {
515515
} // imported ok
516516
}
517517
}
518-
ctrace!(MINER, "Pushed {}/{} transactions", tx_count, tx_total);
518+
cdebug!(MINER, "Pushed {}/{} transactions", tx_count, tx_total);
519519

520520
let transactions_root = {
521521
let parent_hash = open_block.header().parent_hash();
@@ -551,7 +551,7 @@ impl Miner {
551551
&& !self.options.force_sealing
552552
&& Instant::now() <= *self.next_mandatory_reseal.read()
553553
{
554-
ctrace!(MINER, "seal_block_internally: no sealing.");
554+
cdebug!(MINER, "seal_block_internally: no sealing.");
555555
return false
556556
}
557557
ctrace!(MINER, "seal_block_internally: attempting internal seal.");

core/src/verification/queue/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl QueueSignal {
9797
if !self.signalled.compare_and_swap(false, true, AtomicOrdering::Relaxed) {
9898
let channel = self.message_channel.lock().clone();
9999
if let Err(e) = channel.send_sync(self.message.clone()) {
100-
debug!("Error sending verified message: {:?}", e);
100+
cwarn!(ENGINE, "Error sending verified message: {:?}", e);
101101
}
102102
}
103103
}
@@ -111,7 +111,7 @@ impl QueueSignal {
111111
if !self.signalled.compare_and_swap(false, true, AtomicOrdering::Relaxed) {
112112
let channel = self.message_channel.lock().clone();
113113
if let Err(e) = channel.send(self.message.clone()) {
114-
debug!("Error sending verified message: {:?}", e);
114+
cwarn!(ENGINE, "Error sending verified message: {:?}", e);
115115
}
116116
}
117117
}

sync/src/transaction/extension.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl NetworkExtension<Never> for Extension {
121121
for unverified in transactions.iter() {
122122
peer.push(*unverified);
123123
}
124-
cdebug!(SYNC_TX, "Receive {} transactions from {}", transactions.len(), token);
124+
cinfo!(SYNC_TX, "Receive {} transactions from {}", transactions.len(), token);
125125
ctrace!(SYNC_TX, "Receive {:?}", transactions);
126126
} else {
127127
cwarn!(SYNC_TX, "Message from {} but it's already removed", token);
@@ -161,7 +161,7 @@ impl Extension {
161161
for h in unsent_hashes.iter() {
162162
peer.push(*h);
163163
}
164-
cdebug!(SYNC_TX, "Send {} transactions to {}", unsent.len(), token);
164+
cinfo!(SYNC_TX, "Send {} transactions to {}", unsent.len(), token);
165165
ctrace!(SYNC_TX, "Send {:?}", unsent_hashes);
166166
self.api.send(token, Arc::new(Message::Transactions(unsent).rlp_bytes().into_vec()));
167167
}

0 commit comments

Comments
 (0)