mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-13 22:41:25 +02:00
scripted-diff: logging: Drop LogAcceptCategory
-BEGIN VERIFY SCRIPT- sed -i 's/LogAcceptCategory(\(.*\), [a-zA-Z:]*::Level::Debug)/util::log::ShouldDebugLog(\1)/g' $(git grep -l LogAcceptCategory -- '*.cpp') sed -i 's/LogAcceptCategory(\(.*\), [a-zA-Z:]*::Level::Trace)/util::log::ShouldTraceLog(\1)/g' $(git grep -l LogAcceptCategory -- '*.cpp') sed -i '/Return true if log accepts specified category/,/^$/d' src/logging.h -END VERIFY SCRIPT-
This commit is contained in:
@@ -59,7 +59,7 @@ public:
|
||||
// This code is adapted from posix_logger.h, which is why it is using vsprintf.
|
||||
// Please do not do this in normal code
|
||||
void Logv(const char * format, va_list ap) override {
|
||||
if (!LogAcceptCategory(BCLog::LEVELDB, util::log::Level::Debug)) {
|
||||
if (!util::log::ShouldDebugLog(BCLog::LEVELDB)) {
|
||||
return;
|
||||
}
|
||||
char buffer[500];
|
||||
@@ -278,7 +278,7 @@ CDBWrapper::~CDBWrapper()
|
||||
|
||||
void CDBWrapper::WriteBatch(CDBBatch& batch, bool fSync)
|
||||
{
|
||||
const bool log_memory = LogAcceptCategory(BCLog::LEVELDB, util::log::Level::Debug);
|
||||
const bool log_memory = util::log::ShouldDebugLog(BCLog::LEVELDB);
|
||||
double mem_before = 0;
|
||||
if (log_memory) {
|
||||
mem_before = DynamicMemoryUsage() / double(1_MiB);
|
||||
|
||||
Reference in New Issue
Block a user