|
| LoggerImpl (LoggerImpl const &)=delete |
|
LoggerImpl & | operator= (LoggerImpl const &)=delete |
|
template<bool enable_immediate_flush, typename... Args> |
QUILL_ATTRIBUTE_HOT bool | log_statement (MacroMetadata const *macro_metadata, Args &&... fmt_args) |
| Push a log message to the spsc queue to be logged by the backend thread. More...
|
|
template<bool enable_immediate_flush, typename... Args> |
QUILL_ATTRIBUTE_HOT bool | log_statement_runtime_metadata (MacroMetadata const *macro_metadata, char const *fmt, char const *file_path, char const *function_name, char const *tags, uint32_t line_number, LogLevel log_level, Args &&... fmt_args) |
| Push a log message with runtime metadata to the spsc queue to be logged by the backend thread. More...
|
|
void | init_backtrace (uint32_t max_capacity, LogLevel flush_level=LogLevel::None) |
| Init a backtrace for this logger. More...
|
|
void | flush_backtrace () |
| Dump any stored backtrace messages.
|
|
void | flush_log (uint32_t sleep_duration_ns=100) |
| Blocks the calling thread until all log messages up to the current timestamp are flushed. More...
|
|
| 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...
|
|
|
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 QUILL_THREAD_LOCAL ThreadContext * | _thread_context = nullptr |
|
template<typename TFrontendOptions>
class LoggerImpl< TFrontendOptions >
Thread safe logger.
Logger must be obtained from create_or_get_logger(), therefore, constructors are private