MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / Consume

Method Consume

src/logging.cpp:399–413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397}
398
399BCLog::LogRateLimiter::Status BCLog::LogRateLimiter::Consume(
400 const SourceLocation& source_loc,
401 const std::string& str)
402{
403 STDLOCK(m_mutex);
404 auto& stats{m_source_locations.try_emplace(source_loc, m_max_bytes).first->second};
405 Status status{stats.m_dropped_bytes > 0 ? Status::STILL_SUPPRESSED : Status::UNSUPPRESSED};
406
407 if (!stats.Consume(str.size()) && status == Status::UNSUPPRESSED) {
408 status = Status::NEWLY_SUPPRESSED;
409 m_suppression_active = true;
410 }
411
412 return status;
413}
414
415std::string BCLog::Logger::Format(const util::log::Entry& entry) const
416{

Callers 2

LogPrint_Method · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80

Calls 1

sizeMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64