mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 05:44:44 +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:
@@ -206,7 +206,7 @@ impl<T: BeaconChainTypes> AttestationService<T> {
|
||||
// This will subscribe to long-lived random subnets if required.
|
||||
trace!(self.log,
|
||||
"Validator subscription";
|
||||
"subscription" => format!("{:?}", subscription),
|
||||
"subscription" => ?subscription,
|
||||
);
|
||||
self.add_known_validator(subscription.validator_index);
|
||||
|
||||
@@ -220,7 +220,7 @@ impl<T: BeaconChainTypes> AttestationService<T> {
|
||||
Err(e) => {
|
||||
warn!(self.log,
|
||||
"Failed to compute subnet id for validator subscription";
|
||||
"error" => format!("{:?}", e),
|
||||
"error" => ?e,
|
||||
"validator_index" => subscription.validator_index
|
||||
);
|
||||
continue;
|
||||
@@ -257,7 +257,7 @@ impl<T: BeaconChainTypes> AttestationService<T> {
|
||||
} else {
|
||||
trace!(self.log,
|
||||
"Subscribed to subnet for aggregator duties";
|
||||
"exact_subnet" => format!("{:?}", exact_subnet),
|
||||
"exact_subnet" => ?exact_subnet,
|
||||
"validator_index" => subscription.validator_index
|
||||
);
|
||||
}
|
||||
@@ -339,7 +339,7 @@ impl<T: BeaconChainTypes> AttestationService<T> {
|
||||
// peer before they can be removed.
|
||||
warn!(self.log,
|
||||
"Not enough time for a discovery search";
|
||||
"subnet_id" => format!("{:?}", exact_subnet)
|
||||
"subnet_id" => ?exact_subnet
|
||||
);
|
||||
None
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user