mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 10:22:38 +00:00
No string in slog (#2017)
## Issue Addressed Following slog's documentation, this should help a bit with string allocations. I left it run for two days and mem usage is lower. This is of course anecdotal, but shouldn't harm anyway ## Proposed Changes remove `String` creation in logs when possible
This commit is contained in:
@@ -513,7 +513,7 @@ impl<T: BeaconChainTypes> SyncingChain<T> {
|
||||
// This should be unlikely, so we tolerate these errors, but not often.
|
||||
let action = PeerAction::LowToleranceError;
|
||||
warn!(self.log, "Batch failed to download. Dropping chain scoring peers";
|
||||
"score_adjustment" => action.to_string(),
|
||||
"score_adjustment" => %action,
|
||||
"batch_epoch"=> batch_id);
|
||||
for (peer, _) in self.peers.drain() {
|
||||
network.report_peer(peer, action);
|
||||
@@ -1028,7 +1028,7 @@ impl<T: BeaconChainTypes> slog::KV for SyncingChain<T> {
|
||||
"to",
|
||||
serializer,
|
||||
)?;
|
||||
serializer.emit_str("end_root", &self.target_head_root.to_string())?;
|
||||
serializer.emit_arguments("end_root", &format_args!("{}", self.target_head_root))?;
|
||||
Value::serialize(
|
||||
&self.processing_target,
|
||||
record,
|
||||
|
||||
Reference in New Issue
Block a user