quill
Public Member Functions | List of all members
Filter Class Referenceabstract

Base filter class. More...

#include <Filter.h>

Inheritance diagram for Filter:
Inheritance graph
[legend]

Public Member Functions

 Filter (std::string filter_name)
 Constructor. More...
 
virtual ~Filter ()=default
 Destructor.
 
virtual QUILL_NODISCARD bool filter (MacroMetadata const *log_metadata, uint64_t log_timestamp, std::string_view thread_id, std::string_view thread_name, std::string_view logger_name, LogLevel log_level, std::string_view log_message, std::string_view log_statement) noexcept=0
 Filters a log message. More...
 
virtual QUILL_NODISCARD std::string const & get_filter_name () const noexcept
 Gets the name of the filter. More...
 

Detailed Description

Base filter class.

Filters can be added to Sinks

Constructor & Destructor Documentation

◆ Filter()

Filter::Filter ( std::string  filter_name)
inlineexplicit

Constructor.

Parameters
filter_nameunique filter name

Member Function Documentation

◆ filter()

virtual QUILL_NODISCARD bool Filter::filter ( MacroMetadata const *  log_metadata,
uint64_t  log_timestamp,
std::string_view  thread_id,
std::string_view  thread_name,
std::string_view  logger_name,
LogLevel  log_level,
std::string_view  log_message,
std::string_view  log_statement 
)
pure virtualnoexcept

Filters a log message.

Parameters
log_metadataPointer to the macro metadata.
log_timestampTimestamp of the log event.
thread_idID of the thread.
thread_nameName of the thread.
logger_nameName of the logger.
log_levelLog level of the message.
log_messageThe log message.
log_statementThe log statement.
Returns
true if the log message should be written to the file, false otherwise

◆ get_filter_name()

virtual QUILL_NODISCARD std::string const& Filter::get_filter_name ( ) const
inlinevirtualnoexcept

Gets the name of the filter.

Only useful if an existing filter is needed to be looked up

Returns
the name of the filter

The documentation for this class was generated from the following file: