本文整理汇总了C++中beast::Journal::fatal方法的典型用法代码示例。如果您正苦于以下问题:C++ Journal::fatal方法的具体用法?C++ Journal::fatal怎么用?C++ Journal::fatal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类beast::Journal
的用法示例。
在下文中一共展示了Journal::fatal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool
adjustDescriptorLimit(int needed, beast::Journal j)
{
#ifdef RLIMIT_NOFILE
// Get the current limit, then adjust it to what we need.
struct rlimit rl;
int available = 0;
if (getrlimit(RLIMIT_NOFILE, &rl) == 0)
{
// If the limit is infinite, then we are good.
if (rl.rlim_cur == RLIM_INFINITY)
available = needed;
else
available = rl.rlim_cur;
if (available < needed)
{
// Ignore the rlim_max, as the process may
// be configured to override it anyways. We
// ask for the number descriptors we need.
rl.rlim_cur = needed;
if (setrlimit(RLIMIT_NOFILE, &rl) == 0)
available = rl.rlim_cur;
}
}
if (needed > available)
{
j.fatal() <<
"Insufficient number of file descriptors: " <<
needed << " are needed, but only " <<
available << " are available.";
std::cerr <<
"Insufficient number of file descriptors: " <<
needed << " are needed, but only " <<
available << " are available.\n";
return false;
}
#endif
return true;
}
示例2: pfctx
PreflightResult
preflight(Application& app, Rules const& rules,
STTx const& tx, ApplyFlags flags,
beast::Journal j)
{
PreflightContext const pfctx(app, tx,
rules, flags, j);
try
{
return{ pfctx, invoke_preflight(pfctx) };
}
catch (std::exception const& e)
{
JLOG(j.fatal()) <<
"apply: " << e.what();
return{ pfctx, tefEXCEPTION };
}
}
示例3: stopAsyncRecursive
void Stoppable::stopAsyncRecursive (beast::Journal j)
{
using namespace std::chrono;
auto const start = high_resolution_clock::now();
onStop ();
auto const ms = duration_cast<milliseconds>(
high_resolution_clock::now() - start).count();
#ifdef NDEBUG
if (ms >= 10)
if (auto stream = j.fatal())
stream << m_name << "::onStop took " << ms << "ms";
#else
(void)ms;
#endif
for (Children::const_iterator iter (m_children.cbegin ());
iter != m_children.cend(); ++iter)
iter->stoppable->stopAsyncRecursive(j);
}
示例4: assertSane
bool Ledger::assertSane (beast::Journal ledgerJ) const
{
if (info_.hash.isNonZero () &&
info_.accountHash.isNonZero () &&
stateMap_ &&
txMap_ &&
(info_.accountHash == stateMap_->getHash ().as_uint256()) &&
(info_.txHash == txMap_->getHash ().as_uint256()))
{
return true;
}
Json::Value j = getJson (*this);
j [jss::accountTreeHash] = to_string (info_.accountHash);
j [jss::transTreeHash] = to_string (info_.txHash);
JLOG (ledgerJ.fatal()) << "ledger is not sane" << j;
assert (false);
return false;
}