quill
|
Public Member Functions | |
LoggerBase (std::string logger_name, std::vector< std::shared_ptr< Sink >> sinks, PatternFormatterOptions pattern_formatter_options, ClockSourceType clock_source, UserClockSource *user_clock) | |
LoggerBase (LoggerBase const &)=delete | |
LoggerBase & | operator= (LoggerBase const &)=delete |
QUILL_NODISCARD std::string const & | get_logger_name () const noexcept |
Returns the name of the logger. More... | |
QUILL_NODISCARD UserClockSource * | get_user_clock_source () const noexcept |
Returns the user-defined clock source. More... | |
QUILL_NODISCARD ClockSourceType | get_clock_source_type () const noexcept |
Returns the type of clock source being used. More... | |
QUILL_NODISCARD PatternFormatterOptions const & | get_pattern_formatter_options () const noexcept |
Returns the pattern formatter options. More... | |
QUILL_NODISCARD std::vector< std::shared_ptr< Sink > > const & | get_sinks () const noexcept |
Returns a const reference to the sinks vector. More... | |
void | mark_invalid () |
This function sets the logger's validity flag to false, indicating that the logger is no longer valid. | |
QUILL_NODISCARD bool | is_valid_logger () const noexcept |
Checks if the logger is valid. More... | |
QUILL_NODISCARD LogLevel | get_log_level () const noexcept |
void | set_log_level (LogLevel new_log_level) |
Set the log level of the logger. More... | |
void | set_immediate_flush (uint32_t flush_every_n_messages=1) |
Sets the flush interval for logging based on message count. More... | |
template<LogLevel log_statement_level> | |
QUILL_NODISCARD QUILL_ATTRIBUTE_HOT bool | should_log_statement () const noexcept |
Checks if the given log_statement_level can be logged by this logger. More... | |
QUILL_NODISCARD QUILL_ATTRIBUTE_HOT bool | should_log_statement (LogLevel log_statement_level) const noexcept |
Checks if the given log_statement_level can be logged by this logger. More... | |
Protected Attributes | |
std::string | _logger_name |
UserClockSource * | _user_clock {nullptr} |
std::atomic< uint32_t > | _message_flush_threshold {0} |
std::atomic< uint32_t > | _messages_since_last_flush {0} |
ClockSourceType | _clock_source |
std::atomic< LogLevel > | _log_level {LogLevel::Info} |
std::atomic< LogLevel > | _backtrace_flush_level {LogLevel::None} |
std::atomic< bool > | _valid {true} |
Updated by the frontend at any time, accessed by the backend. | |
PatternFormatterOptions | _pattern_formatter_options |
std::vector< std::shared_ptr< Sink > > | _sinks |
std::shared_ptr< PatternFormatter > | _pattern_formatter |
std::shared_ptr< BacktraceStorage > | _backtrace_storage |
Static Protected Attributes | |
static QUILL_THREAD_LOCAL ThreadContext * | _thread_context = nullptr |
Friends | |
class | BackendWorker |
class | LoggerManager |
|
inlinenoexcept |
Returns the type of clock source being used.
|
inlinenoexcept |
|
inlinenoexcept |
Returns the name of the logger.
|
inlinenoexcept |
Returns the pattern formatter options.
|
inlinenoexcept |
Returns a const reference to the sinks vector.
|
inlinenoexcept |
Returns the user-defined clock source.
|
inlinenoexcept |
Checks if the logger is valid.
|
inline |
Sets the flush interval for logging based on message count.
When enabled, this will automatically call flush_log after the specified number of messages have been logged
This is particularly valuable when:
flush_every_n_messages | number of messages before auto-flush (0 to disable) |
|
inline |
Set the log level of the logger.
new_log_level | The new log level |
|
inlinenoexcept |
Checks if the given log_statement_level can be logged by this logger.
|
inlinenoexcept |
Checks if the given log_statement_level can be logged by this logger.
log_statement_level | The log level of the log statement to be logged |