mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Log detailed correlated consensus data together (#5302)
Combine multiple related debug log data points into a single message. Allows quick correlation of events that previously were either not logged or, if logged, strewn across multiple lines, making correlation difficult. The Heartbeat Timer and consensus ledger accept processing each have this capability. Also guarantees that log entries will be written if the node is a validator, regardless of log severity level. Otherwise, the level of these messages is at INFO severity.
This commit is contained in:
@@ -116,6 +116,10 @@ struct Peer
|
||||
}
|
||||
};
|
||||
|
||||
class TestConsensusLogger
|
||||
{
|
||||
};
|
||||
|
||||
/** Generic Validations adaptor that simply ignores recently stale
|
||||
* validations
|
||||
*/
|
||||
@@ -532,7 +536,8 @@ struct Peer
|
||||
closeResolution,
|
||||
rawCloseTimes,
|
||||
mode,
|
||||
std::move(consensusJson));
|
||||
std::move(consensusJson),
|
||||
validating());
|
||||
}
|
||||
|
||||
void
|
||||
@@ -542,7 +547,8 @@ struct Peer
|
||||
NetClock::duration const& closeResolution,
|
||||
ConsensusCloseTimes const& rawCloseTimes,
|
||||
ConsensusMode const& mode,
|
||||
Json::Value&& consensusJson)
|
||||
Json::Value&& consensusJson,
|
||||
const bool validating)
|
||||
{
|
||||
schedule(delays.ledgerAccept, [=, this]() {
|
||||
const bool proposing = mode == ConsensusMode::proposing;
|
||||
@@ -877,6 +883,13 @@ struct Peer
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
validating() const
|
||||
{
|
||||
// does not matter
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// A locally submitted transaction
|
||||
void
|
||||
@@ -917,7 +930,7 @@ struct Peer
|
||||
// Not yet modeling dynamic UNL.
|
||||
hash_set<PeerID> nowUntrusted;
|
||||
consensus.startRound(
|
||||
now(), bestLCL, lastClosedLedger, nowUntrusted, runAsValidator);
|
||||
now(), bestLCL, lastClosedLedger, nowUntrusted, runAsValidator, {});
|
||||
}
|
||||
|
||||
// Start the consensus process assuming it is not yet running
|
||||
|
||||
@@ -57,6 +57,14 @@ public:
|
||||
std::cout << clock_.now().time_since_epoch().count() << " " << text
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
void
|
||||
writeAlways(beast::severities::Severity level, std::string const& text)
|
||||
override
|
||||
{
|
||||
std::cout << clock_.now().time_since_epoch().count() << " " << text
|
||||
<< std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
class Sim
|
||||
|
||||
Reference in New Issue
Block a user