Skip to content

Commit 6b42b3b

Browse files
committed
Rename db log category to walletdb (like coindb)
Deprecate (but still accept) '-debug=db'.
1 parent 8021392 commit 6b42b3b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/logging.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,15 @@ void BCLog::Logger::EnableCategory(BCLog::LogFlags flag)
9595
bool BCLog::Logger::EnableCategory(const std::string& str)
9696
{
9797
BCLog::LogFlags flag;
98-
if (!GetLogCategory(flag, str)) return false;
98+
if (!GetLogCategory(flag, str)) {
99+
if (str == "db") {
100+
// DEPRECATION: Added in 0.20, should start returning an error in 0.21
101+
LogPrintf("Warning: logging category 'db' is deprecated, use 'walletdb' instead\n");
102+
EnableCategory(BCLog::DB);
103+
return true;
104+
}
105+
return false;
106+
}
99107
EnableCategory(flag);
100108
return true;
101109
}
@@ -139,7 +147,7 @@ const CLogCategoryDesc LogCategories[] =
139147
{BCLog::HTTP, "http"},
140148
{BCLog::BENCH, "bench"},
141149
{BCLog::ZMQ, "zmq"},
142-
{BCLog::DB, "db"},
150+
{BCLog::DB, "walletdb"},
143151
{BCLog::RPC, "rpc"},
144152
{BCLog::ESTIMATEFEE, "estimatefee"},
145153
{BCLog::ADDRMAN, "addrman"},

0 commit comments

Comments
 (0)