#include <logging.h>
#include <memusage.h>
#include <util/check.h>
#include <util/fs.h>
#include <util/string.h>
#include <util/threadnames.h>
#include <util/time.h>
#include <array>
#include <cstring>
#include <map>
#include <optional>
#include <utility>
Go to the source code of this file.
◆ FileWriteStr()
| int FileWriteStr |
( |
std::string_view | str, |
|
|
FILE * | fp ) |
|
static |
◆ GetLogCategory()
Return true if str parses as a log category and set the flag.
Definition at line 220 of file logging.cpp.
◆ GetLogLevel()
| std::optional< BCLog::Level > GetLogLevel |
( |
std::string_view | level_str | ) |
|
|
static |
◆ Join()
template<typename C, typename
S, typename UnaryOp>
| auto util::Join |
( |
const C & | container, |
|
|
const S & | separator, |
|
|
UnaryOp | unary_op ) |
Join all container items.
Typically used to concatenate strings but accepts containers with elements of any type.
- Parameters
-
| container | The items to join |
| separator | The separator |
| unary_op | Apply this operator to each item |
Definition at line 205 of file string.h.
◆ LogCategoryToStr()
◆ 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 LogInfo, 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.
◆ LogLevelsList()
Log severity levels that can be selected by the user.
Definition at line 289 of file logging.cpp.
◆ MemUsage()
◆ RemovePrefixView()
◆ DEFAULT_DEBUGLOGFILE
| const char* const DEFAULT_DEBUGLOGFILE = "debug.log" |
◆ fLogIPs
◆ LOG_CATEGORIES_BY_FLAG
| const std::unordered_map<BCLog::LogFlags, std::string> LOG_CATEGORIES_BY_FLAG |
|
static |
Initial value:{
[](const auto& in) {
std::unordered_map<BCLog::LogFlags, std::string> out;
for (
const auto& [
k, v] : in) {
const bool inserted{out.emplace(v,
k).second};
}
}
static const std::map< std::string, BCLog::LogFlags, std::less<> > LOG_CATEGORIES_BY_STR
Definition at line 208 of file logging.cpp.
◆ LOG_CATEGORIES_BY_STR
| const std::map<std::string, BCLog::LogFlags, std::less<> > LOG_CATEGORIES_BY_STR |
|
static |
◆ MAX_USER_SETABLE_SEVERITY_LEVEL
| auto MAX_USER_SETABLE_SEVERITY_LEVEL {BCLog::Level::Info} |
|
constexpr |