Skip to content

Commit

Permalink
Prefix leveldb debug logging
Browse files Browse the repository at this point in the history
Add leveldb: prefix to leveldb debug logging lines.
leveldb debug messages come in various scary flavors such as:

    2017-11-30 08:26:31 leveldb: Recovering log #26
    2017-11-30 08:26:31 leveldb: Level-0 table #28: started
    2017-11-30 08:26:31 leveldb: Level-0 table #28: 597 bytes OK
    2017-11-30 08:26:31 leveldb: Delete type=0 #26
    2017-11-30 08:26:31 leveldb: Delete type=3 #24

so it's reasonably important to mark them as coming from leveldb
internals and not from consensus validation wallet or such.

(this only affects `-debug=leveldb` or `-debug=1` otherwise you won't
see them in the first place)
  • Loading branch information
laanwj committed Nov 30, 2017
1 parent 6d3dc52 commit 9b80fc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dbwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class CBitcoinLevelDBLogger : public leveldb::Logger {

assert(p <= limit);
base[std::min(bufsize - 1, (int)(p - base))] = '\0';
LogPrintStr(base);
LogPrintf("leveldb: %s", base);
if (base != buffer) {
delete[] base;
}
Expand Down

0 comments on commit 9b80fc1

Please sign in to comment.