Bitcoin Core 28.99.0
P2P Digital Currency
Classes | Typedefs | Enumerations | Functions | Variables
BCLog Namespace Reference

Classes

class  Logger
 
class  Timer
 RAII-style object that outputs timing information to logs. More...
 

Typedefs

using CategoryMask = uint64_t
 

Enumerations

enum  LogFlags : CategoryMask {
  NONE = CategoryMask{0} , NET = (CategoryMask{1} << 0) , TOR = (CategoryMask{1} << 1) , MEMPOOL = (CategoryMask{1} << 2) ,
  HTTP = (CategoryMask{1} << 3) , BENCH = (CategoryMask{1} << 4) , ZMQ = (CategoryMask{1} << 5) , WALLETDB = (CategoryMask{1} << 6) ,
  RPC = (CategoryMask{1} << 7) , ESTIMATEFEE = (CategoryMask{1} << 8) , ADDRMAN = (CategoryMask{1} << 9) , SELECTCOINS = (CategoryMask{1} << 10) ,
  REINDEX = (CategoryMask{1} << 11) , CMPCTBLOCK = (CategoryMask{1} << 12) , RAND = (CategoryMask{1} << 13) , PRUNE = (CategoryMask{1} << 14) ,
  PROXY = (CategoryMask{1} << 15) , MEMPOOLREJ = (CategoryMask{1} << 16) , LIBEVENT = (CategoryMask{1} << 17) , COINDB = (CategoryMask{1} << 18) ,
  QT = (CategoryMask{1} << 19) , LEVELDB = (CategoryMask{1} << 20) , VALIDATION = (CategoryMask{1} << 21) , I2P = (CategoryMask{1} << 22) ,
  IPC = (CategoryMask{1} << 23) , BLOCKSTORAGE = (CategoryMask{1} << 25) , TXRECONCILIATION = (CategoryMask{1} << 26) , SCAN = (CategoryMask{1} << 27) ,
  TXPACKAGES = (CategoryMask{1} << 28) , ALL = ~NONE
}
 
enum class  Level {
  Trace = 0 , Debug , Info , Warning ,
  Error
}
 

Functions

std::string LogEscapeMessage (std::string_view str)
 Belts and suspenders: make sure outgoing log messages don't contain potentially suspicious characters, such as terminal control codes. More...
 

Variables

constexpr auto DEFAULT_LOG_LEVEL {Level::Debug}
 
constexpr size_t DEFAULT_MAX_LOG_BUFFER {1'000'000}
 

Typedef Documentation

◆ CategoryMask

using BCLog::CategoryMask = typedef uint64_t

Definition at line 40 of file logging.h.

Enumeration Type Documentation

◆ Level

enum class BCLog::Level
strong
Enumerator
Trace 
Debug 
Info 
Warning 
Error 

Definition at line 76 of file logging.h.

◆ LogFlags

Enumerator
NONE 
NET 
TOR 
MEMPOOL 
HTTP 
BENCH 
ZMQ 
WALLETDB 
RPC 
ESTIMATEFEE 
ADDRMAN 
SELECTCOINS 
REINDEX 
CMPCTBLOCK 
RAND 
PRUNE 
PROXY 
MEMPOOLREJ 
LIBEVENT 
COINDB 
QT 
LEVELDB 
VALIDATION 
I2P 
IPC 
BLOCKSTORAGE 
TXRECONCILIATION 
SCAN 
TXPACKAGES 
ALL 

Definition at line 41 of file logging.h.

Function Documentation

◆ LogEscapeMessage()

std::string BCLog::LogEscapeMessage ( std::string_view  str)

Belts and suspenders: make sure outgoing log messages don't contain potentially suspicious characters, such as terminal control codes.

This escapes control characters except newline ('
') in C syntax. It escapes instead of removes them to still allow for troubleshooting issues where they accidentally end up in strings.

Definition at line 325 of file logging.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ DEFAULT_LOG_LEVEL

constexpr auto BCLog::DEFAULT_LOG_LEVEL {Level::Debug}
constexpr

Definition at line 83 of file logging.h.

◆ DEFAULT_MAX_LOG_BUFFER

constexpr size_t BCLog::DEFAULT_MAX_LOG_BUFFER {1'000'000}
constexpr

Definition at line 84 of file logging.h.