#include <crypto/siphash.h>
#include <threadsafety.h>
#include <tinyformat.h>
#include <util/fs.h>
#include <util/string.h>
#include <util/time.h>
#include <atomic>
#include <cstdint>
#include <cstring>
#include <functional>
#include <list>
#include <memory>
#include <mutex>
#include <source_location>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
Go to the source code of this file.
|
| #define | LogPrintLevel_(category, level, should_ratelimit, ...) LogPrintFormatInternal(std::source_location::current(), category, level, should_ratelimit, __VA_ARGS__) |
| |
| #define | LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, /*should_ratelimit=*/true, __VA_ARGS__) |
| |
| #define | LogWarning(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Warning, /*should_ratelimit=*/true, __VA_ARGS__) |
| |
| #define | LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, /*should_ratelimit=*/true, __VA_ARGS__) |
| |
| #define | LogPrintf(...) LogInfo(__VA_ARGS__) |
| |
| #define | LogPrintLevel(category, level, ...) |
| |
| #define | LogDebug(category, ...) LogPrintLevel(category, BCLog::Level::Debug, __VA_ARGS__) |
| |
| #define | LogTrace(category, ...) LogPrintLevel(category, BCLog::Level::Trace, __VA_ARGS__) |
| |
|
| enum | BCLog::LogFlags : CategoryMask {
BCLog::NONE = CategoryMask{0},
BCLog::NET = (CategoryMask{1} << 0),
BCLog::TOR = (CategoryMask{1} << 1),
BCLog::MEMPOOL = (CategoryMask{1} << 2),
BCLog::HTTP = (CategoryMask{1} << 3),
BCLog::BENCH = (CategoryMask{1} << 4),
BCLog::ZMQ = (CategoryMask{1} << 5),
BCLog::WALLETDB = (CategoryMask{1} << 6),
BCLog::RPC = (CategoryMask{1} << 7),
BCLog::ESTIMATEFEE = (CategoryMask{1} << 8),
BCLog::ADDRMAN = (CategoryMask{1} << 9),
BCLog::SELECTCOINS = (CategoryMask{1} << 10),
BCLog::REINDEX = (CategoryMask{1} << 11),
BCLog::CMPCTBLOCK = (CategoryMask{1} << 12),
BCLog::RAND = (CategoryMask{1} << 13),
BCLog::PRUNE = (CategoryMask{1} << 14),
BCLog::PROXY = (CategoryMask{1} << 15),
BCLog::MEMPOOLREJ = (CategoryMask{1} << 16),
BCLog::LIBEVENT = (CategoryMask{1} << 17),
BCLog::COINDB = (CategoryMask{1} << 18),
BCLog::QT = (CategoryMask{1} << 19),
BCLog::LEVELDB = (CategoryMask{1} << 20),
BCLog::VALIDATION = (CategoryMask{1} << 21),
BCLog::I2P = (CategoryMask{1} << 22),
BCLog::IPC = (CategoryMask{1} << 23),
BCLog::BLOCKSTORAGE = (CategoryMask{1} << 25),
BCLog::TXRECONCILIATION = (CategoryMask{1} << 26),
BCLog::SCAN = (CategoryMask{1} << 27),
BCLog::TXPACKAGES = (CategoryMask{1} << 28),
BCLog::ALL = ~NONE
} |
| |
| enum | BCLog::Level {
BCLog::Level::Trace = 0,
BCLog::Level::Debug,
BCLog::Level::Info,
BCLog::Level::Warning,
BCLog::Level::Error
} |
| |
◆ LogDebug
◆ LogError
◆ LogInfo
◆ LogPrintf
| #define LogPrintf |
( |
|
... | ) |
LogInfo(__VA_ARGS__) |
◆ LogPrintLevel
| #define LogPrintLevel |
( |
|
category, |
|
|
|
level, |
|
|
|
... |
|
) |
| |
Value:do { \
LogPrintLevel_(category, level, rate_limit, __VA_ARGS__); \
} \
} while (0)
static bool LogAcceptCategory(BCLog::LogFlags category, BCLog::Level level)
Return true if log accepts specified category, at the specified level.
Definition at line 372 of file logging.h.
◆ LogPrintLevel_
| #define LogPrintLevel_ |
( |
|
category, |
|
|
|
level, |
|
|
|
should_ratelimit, |
|
|
|
... |
|
) |
| LogPrintFormatInternal(std::source_location::current(), category, level, should_ratelimit, __VA_ARGS__) |
◆ LogTrace
◆ LogWarning
◆ GetLogCategory()
Return true if str parses as a log category and set the flag.
Definition at line 218 of file logging.cpp.
◆ LogAcceptCategory()
Return true if log accepts specified category, at the specified level.
Definition at line 328 of file logging.h.
◆ LogInstance()
NOTE: the logger instances is leaked on exit. This is ugly, but will be cleaned up by the OS/libc. Defining a logger as a global object doesn't work since the order of destruction of static/global objects is undefined. Consider if the logger gets destroyed, and then some later destructor calls LogPrintf, maybe indirectly, and you get a core dump at shutdown trying to access the logger. When the shutdown sequence is fully audited and tested, explicit destruction of these objects can be implemented by changing this from a raw pointer to a std::unique_ptr. Since the ~Logger() destructor is never called, the Logger class and all its subclasses must have implicitly-defined destructors.
This method of initialization was originally introduced in ee3374234c60aba2cc4c5cd5cac1c0aefc2d817c.
Definition at line 26 of file logging.cpp.
◆ LogPrintFormatInternal()
template<typename... Args>
◆ DEFAULT_DEBUGLOGFILE
| const char* const DEFAULT_DEBUGLOGFILE |
◆ DEFAULT_LOGIPS
| const bool DEFAULT_LOGIPS = false |
|
static |
◆ DEFAULT_LOGLEVELALWAYS
| constexpr bool DEFAULT_LOGLEVELALWAYS = false |
|
static |
◆ DEFAULT_LOGSOURCELOCATIONS
| const bool DEFAULT_LOGSOURCELOCATIONS = false |
|
static |
◆ DEFAULT_LOGTHREADNAMES
| const bool DEFAULT_LOGTHREADNAMES = false |
|
static |
◆ DEFAULT_LOGTIMEMICROS
| const bool DEFAULT_LOGTIMEMICROS = false |
|
static |
◆ DEFAULT_LOGTIMESTAMPS
| const bool DEFAULT_LOGTIMESTAMPS = true |
|
static |
◆ fLogIPs