本文整理汇总了C++中beast::Journal::error方法的典型用法代码示例。如果您正苦于以下问题:C++ Journal::error方法的具体用法?C++ Journal::error怎么用?C++ Journal::error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类beast::Journal
的用法示例。
在下文中一共展示了Journal::error方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sl
std::shared_ptr<Ledger const>
acquire(uint256 const& hash, std::uint32_t seq,
InboundLedger::Reason reason) override
{
assert(hash.isNonZero());
assert(reason != InboundLedger::Reason::SHARD ||
(seq != 0 && app_.getShardStore()));
if (isStopping())
return {};
bool isNew = true;
std::shared_ptr<InboundLedger> inbound;
{
ScopedLockType sl(mLock);
auto it = mLedgers.find(hash);
if (it != mLedgers.end())
{
isNew = false;
inbound = it->second;
}
else
{
inbound = std::make_shared <InboundLedger>(
app_, hash, seq, reason, std::ref(m_clock));
mLedgers.emplace(hash, inbound);
inbound->init(sl);
++mCounter;
}
}
if (inbound->isFailed())
return {};
if (! isNew)
inbound->update(seq);
if (! inbound->isComplete())
return {};
if (reason == InboundLedger::Reason::HISTORY)
{
if (inbound->getLedger()->stateMap().family().isShardBacked())
app_.getNodeStore().copyLedger(inbound->getLedger());
}
else if (reason == InboundLedger::Reason::SHARD)
{
auto shardStore = app_.getShardStore();
if (!shardStore)
{
JLOG(j_.error()) <<
"Acquiring shard with no shard store available";
return {};
}
if (inbound->getLedger()->stateMap().family().isShardBacked())
shardStore->setStored(inbound->getLedger());
else
shardStore->copyLedger(inbound->getLedger());
}
return inbound->getLedger();
}
示例2: stopRecursive
void Stoppable::stopRecursive (beast::Journal j)
{
// Block on each child from the bottom of the tree up.
//
for (Children::const_iterator iter (m_children.cbegin ());
iter != m_children.cend(); ++iter)
iter->stoppable->stopRecursive (j);
// if we get here then all children have stopped
//
m_childrenStopped = true;
onChildrenStopped ();
// Now block on this Stoppable.
//
bool const timedOut (! m_stoppedEvent.wait (1 * 1000)); // milliseconds
if (timedOut)
{
if (auto stream = j.error())
stream << "Waiting for '" << m_name << "' to stop";
m_stoppedEvent.wait ();
}
// once we get here, we know the stoppable has stopped.
m_stopped = true;
}
示例3: do_work
void do_work (CompletionCounter)
{
if (m_stop_called == true)
return;
// We don't have any work to do at this time
if (m_work.empty ())
return;
std::string const name (m_work.front ().names.back());
HandlerType handler (m_work.front ().handler);
m_work.front ().names.pop_back ();
if (m_work.front ().names.empty ())
m_work.pop_front();
HostAndPort const hp (parseName (name));
if (hp.first.empty ())
{
JLOG(m_journal.error()) <<
"Unable to parse '" << name << "'";
m_io_service.post (m_strand.wrap (std::bind (
&ResolverAsioImpl::do_work, this,
CompletionCounter (this))));
return;
}
boost::asio::ip::tcp::resolver::query query (
hp.first, hp.second);
m_resolver.async_resolve (query, std::bind (
&ResolverAsioImpl::do_finish, this, name,
std::placeholders::_1, handler,
std::placeholders::_2,
CompletionCounter (this)));
}