#include <logging.h>
|
| FILE *m_fileout | GUARDED_BY (m_cs) |
| |
| std::list< BufferedLog > m_msgs_before_open | GUARDED_BY (m_cs) |
| |
| bool m_buffering | GUARDED_BY (m_cs) |
| | Buffer messages before logging can be started.
|
| |
| size_t m_max_buffer_memusage | GUARDED_BY (m_cs) |
| |
| size_t m_cur_buffer_memusage | GUARDED_BY (m_cs) |
| |
| size_t m_buffer_lines_discarded | GUARDED_BY (m_cs) |
| |
| std::shared_ptr< LogRateLimiter > m_limiter | GUARDED_BY (m_cs) |
| | Manages the rate limiting of each log location.
|
| |
| std::unordered_map< LogFlags, Level > m_category_log_levels | GUARDED_BY (m_cs) |
| | Category-specific log level. Overrides m_log_level.
|
| |
| void | FormatLogStrInPlace (std::string &str, LogFlags category, Level level, const SourceLocation &source_loc, std::string_view threadname, SystemClock::time_point now, std::chrono::seconds mocktime) const |
| |
| std::string | LogTimestampStr (SystemClock::time_point now, std::chrono::seconds mocktime) const |
| |
| void | LogPrintStr_ (std::string_view str, SourceLocation &&source_loc, BCLog::LogFlags category, BCLog::Level level, bool should_ratelimit) EXCLUSIVE_LOCKS_REQUIRED(m_cs) |
| | Send a string to the log output (internal)
|
| |
| std::string | GetLogPrefix (LogFlags category, Level level) const |
| |
Definition at line 127 of file logging.h.
◆ AddCategoryLogLevel()
◆ CategoryLevels()
| std::unordered_map< LogFlags, Level > BCLog::Logger::CategoryLevels |
( |
| ) |
const |
|
inline |
◆ DefaultShrinkDebugFile()
| bool BCLog::Logger::DefaultShrinkDebugFile |
( |
| ) |
const |
◆ DeleteCallback()
| void BCLog::Logger::DeleteCallback |
( |
std::list< std::function< void(const std::string &)> >::iterator | it | ) |
|
|
inline |
Delete a connection.
Definition at line 208 of file logging.h.
◆ DisableCategory() [1/2]
◆ DisableCategory() [2/2]
| bool BCLog::Logger::DisableCategory |
( |
std::string_view | str | ) |
|
◆ DisableLogging()
| void BCLog::Logger::DisableLogging |
( |
| ) |
|
Disable logging This offers a slight speedup and slightly smaller memory usage compared to leaving the logging system in its default state.
Mostly intended for libbitcoin-kernel apps that don't want any logging. Should be used instead of StartLogging().
Definition at line 111 of file logging.cpp.
◆ DisconnectTestLogger()
| void BCLog::Logger::DisconnectTestLogger |
( |
| ) |
|
◆ EnableCategory() [1/2]
◆ EnableCategory() [2/2]
| bool BCLog::Logger::EnableCategory |
( |
std::string_view | str | ) |
|
◆ Enabled()
| bool BCLog::Logger::Enabled |
( |
| ) |
const |
|
inline |
Returns whether logs will be written to any output.
Definition at line 193 of file logging.h.
◆ FormatLogStrInPlace()
| void BCLog::Logger::FormatLogStrInPlace |
( |
std::string & | str, |
|
|
BCLog::LogFlags | category, |
|
|
BCLog::Level | level, |
|
|
const SourceLocation & | source_loc, |
|
|
std::string_view | threadname, |
|
|
SystemClock::time_point | now, |
|
|
std::chrono::seconds | mocktime ) const |
|
private |
◆ GetCategoryMask()
◆ GetLogPrefix()
◆ GUARDED_BY() [1/8]
◆ GUARDED_BY() [2/8]
◆ GUARDED_BY() [3/8]
Buffer messages before logging can be started.
◆ GUARDED_BY() [4/8]
◆ GUARDED_BY() [5/8]
◆ GUARDED_BY() [6/8]
◆ GUARDED_BY() [7/8]
Manages the rate limiting of each log location.
◆ GUARDED_BY() [8/8]
Category-specific log level. Overrides m_log_level.
◆ LogCategoriesList()
| std::vector< LogCategory > BCLog::Logger::LogCategoriesList |
( |
| ) |
const |
Returns a vector of the log categories in alphabetical order.
Definition at line 278 of file logging.cpp.
◆ LogCategoriesString()
| std::string BCLog::Logger::LogCategoriesString |
( |
| ) |
const |
|
inline |
Returns a string with the log categories in alphabetical order.
Definition at line 275 of file logging.h.
◆ LogLevel()
| Level BCLog::Logger::LogLevel |
( |
| ) |
const |
|
inline |
◆ LogLevelsString()
| std::string BCLog::Logger::LogLevelsString |
( |
| ) |
const |
Returns a string with all user-selectable log levels.
Definition at line 294 of file logging.cpp.
◆ LogLevelToStr()
| std::string BCLog::Logger::LogLevelToStr |
( |
BCLog::Level | level | ) |
|
|
static |
Returns the string representation of a log level.
Definition at line 234 of file logging.cpp.
◆ LogPrintStr()
Send a string to the log output.
Definition at line 424 of file logging.cpp.
◆ LogPrintStr_()
Send a string to the log output (internal)
Definition at line 431 of file logging.cpp.
◆ LogTimestampStr()
| std::string BCLog::Logger::LogTimestampStr |
( |
SystemClock::time_point | now, |
|
|
std::chrono::seconds | mocktime ) const |
|
private |
◆ NumConnections()
| size_t BCLog::Logger::NumConnections |
( |
| ) |
|
|
inline |
◆ SetCategoryLogLevel() [1/2]
| void BCLog::Logger::SetCategoryLogLevel |
( |
const std::unordered_map< LogFlags, Level > & | levels | ) |
|
|
inline |
◆ SetCategoryLogLevel() [2/2]
| bool BCLog::Logger::SetCategoryLogLevel |
( |
std::string_view | category_str, |
|
|
std::string_view | level_str ) |
◆ SetLogLevel() [1/2]
| void BCLog::Logger::SetLogLevel |
( |
Level | level | ) |
|
|
inline |
◆ SetLogLevel() [2/2]
| bool BCLog::Logger::SetLogLevel |
( |
std::string_view | level | ) |
|
◆ SetRateLimiting()
◆ ShrinkDebugFile()
| void BCLog::Logger::ShrinkDebugFile |
( |
| ) |
|
◆ StartLogging()
| bool BCLog::Logger::StartLogging |
( |
| ) |
|
Start logging (and flush all buffered messages)
Definition at line 54 of file logging.cpp.
◆ WillLogCategory()
◆ WillLogCategoryLevel()
◆ GUARDED_BY
Slots that connect to the print signal.
Definition at line 167 of file logging.h.
◆ m_always_print_category_level
◆ m_categories
Log categories bitfield.
Definition at line 160 of file logging.h.
◆ m_cs
◆ m_file_path
◆ m_log_level
If there is no category-specific log level, all logs with a severity level lower than m_log_level will be ignored.
Definition at line 157 of file logging.h.
◆ m_log_sourcelocations
◆ m_log_threadnames
◆ m_log_time_micros
◆ m_log_timestamps
◆ m_print_to_console
| bool BCLog::Logger::m_print_to_console = false |
◆ m_print_to_file
◆ m_reopen_file
| std::atomic<bool> BCLog::Logger::m_reopen_file {false} |
◆ PushBackCallback
Connect a slot to the print signal and return the connection.
Definition at line 200 of file logging.h.
The documentation for this class was generated from the following files: