Access Journal::Stream using member functions (RIPD-1087):

Replace Journal public data members with member function accessors
in order to make Journal lighter weight.  The change makes a
Journal cheaper to pass by value.

Also add missing stream checks (e.g., calls to JLOG) to avoid
text processing that ultimately will not be stored in the log.
This commit is contained in:
Scott Schurr
2016-03-09 10:48:21 -08:00
committed by seelabs
parent b3f5986c83
commit 7a4bd2278d
132 changed files with 1843 additions and 1799 deletions

View File

@@ -63,7 +63,7 @@ ValidatorList::insertEphemeralKey (
if (permanent_.find (identity) != permanent_.end())
{
JLOG (j_.error) <<
JLOG (j_.error()) <<
toBase58 (TokenType::TOKEN_NODE_PUBLIC, identity) <<
": ephemeral key exists in permanent table!";
return false;
@@ -89,7 +89,7 @@ ValidatorList::insertPermanentKey (
if (ephemeral_.find (identity) != ephemeral_.end())
{
JLOG (j_.error) <<
JLOG (j_.error()) <<
toBase58 (TokenType::TOKEN_NODE_PUBLIC, identity) <<
": permanent key exists in ephemeral table!";
return false;
@@ -141,21 +141,21 @@ ValidatorList::load (
")?" // end optional comment block
);
JLOG (j_.debug) <<
JLOG (j_.debug()) <<
"Loading configured validators";
std::size_t count = 0;
for (auto const& n : validators.values ())
{
JLOG (j_.trace) <<
JLOG (j_.trace()) <<
"Processing '" << n << "'";
boost::smatch match;
if (!boost::regex_match (n, match, re))
{
JLOG (j_.error) <<
JLOG (j_.error()) <<
"Malformed entry: '" << n << "'";
return false;
}
@@ -165,14 +165,14 @@ ValidatorList::load (
if (!id)
{
JLOG (j_.error) <<
JLOG (j_.error()) <<
"Invalid node identity: " << match[1];
return false;
}
if (trusted (*id))
{
JLOG (j_.warning) <<
JLOG (j_.warn()) <<
"Duplicate node identity: " << match[1];
continue;
}
@@ -181,7 +181,7 @@ ValidatorList::load (
++count;
}
JLOG (j_.debug) <<
JLOG (j_.debug()) <<
"Loaded " << count << " entries";
return true;