Bitcoin ABC 0.32.4
P2P Digital Currency
Classes | Enumerations | Functions | Variables
BCLog Namespace Reference

Classes

class  Logger
 
class  LogRateLimiter
 Fixed window rate limiter for logging. More...
 
class  Timer
 RAII-style object that outputs timing information to logs. More...
 

Enumerations

enum  LogFlags : uint32_t {
  NONE = 0 , NET = (1 << 0) , TOR = (1 << 1) , MEMPOOL = (1 << 2) ,
  HTTP = (1 << 3) , BENCH = (1 << 4) , ZMQ = (1 << 5) , WALLETDB = (1 << 6) ,
  RPC = (1 << 7) , ESTIMATEFEE = (1 << 8) , ADDRMAN = (1 << 9) , SELECTCOINS = (1 << 10) ,
  REINDEX = (1 << 11) , CMPCTBLOCK = (1 << 12) , RAND = (1 << 13) , PRUNE = (1 << 14) ,
  PROXY = (1 << 15) , MEMPOOLREJ = (1 << 16) , LIBEVENT = (1 << 17) , COINDB = (1 << 18) ,
  QT = (1 << 19) , LEVELDB = (1 << 20) , VALIDATION = (1 << 21) , AVALANCHE = (1 << 22) ,
  I2P = (1 << 23) , CHRONIK = (1 << 24) , BLOCKSTORE = (1 << 26) , NETDEBUG = (1 << 27) ,
  TXPACKAGES = (1 << 28) , ALL = ~uint32_t(0)
}
 
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}
 
constexpr uint64_t RATELIMIT_MAX_BYTES {1024 * 1024}
 
constexpr auto RATELIMIT_WINDOW {1h}
 
constexpr bool DEFAULT_LOGRATELIMIT {true}
 

Enumeration Type Documentation

◆ Level

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

Definition at line 103 of file logging.h.

◆ LogFlags

enum BCLog::LogFlags : uint32_t
Enumerator
NONE 
NET 
TOR 
MEMPOOL 
HTTP 
BENCH 
ZMQ 
WALLETDB 
RPC 
ESTIMATEFEE 
ADDRMAN 
SELECTCOINS 
REINDEX 
CMPCTBLOCK 
RAND 
PRUNE 
PROXY 
MEMPOOLREJ 
LIBEVENT 
COINDB 
QT 
LEVELDB 
VALIDATION 
AVALANCHE 
I2P 
CHRONIK 
BLOCKSTORE 
NETDEBUG 
TXPACKAGES 
ALL 

Definition at line 67 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 304 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 113 of file logging.h.

◆ DEFAULT_LOGRATELIMIT

constexpr bool BCLog::DEFAULT_LOGRATELIMIT {true}
constexpr

Definition at line 121 of file logging.h.

◆ DEFAULT_MAX_LOG_BUFFER

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

Definition at line 115 of file logging.h.

◆ RATELIMIT_MAX_BYTES

constexpr uint64_t BCLog::RATELIMIT_MAX_BYTES {1024 * 1024}
constexpr

Definition at line 118 of file logging.h.

◆ RATELIMIT_WINDOW

constexpr auto BCLog::RATELIMIT_WINDOW {1h}
constexpr

Definition at line 120 of file logging.h.