quill
Public Types | Public Member Functions | Static Protected Member Functions | List of all members
PatternFormatter Class Reference
Inheritance diagram for PatternFormatter:
Inheritance graph
[legend]

Public Types

enum  TimestampPrecision : uint8_t { None, MilliSeconds, MicroSeconds, NanoSeconds }
 Public classes. More...
 
enum  Attribute : uint8_t {
  Time = 0, FileName, CallerFunction, LogLevel,
  LogLevelShortCode, LineNumber, Logger, FullPath,
  ThreadId, ThreadName, ProcessId, SourceLocation,
  ShortSourceLocation, Message, Tags, NamedArgs,
  ATTR_NR_ITEMS
}
 

Public Member Functions

 PatternFormatter (PatternFormatterOptions options)
 Main PatternFormatter class. More...
 
 PatternFormatter (PatternFormatter const &other)=delete
 
PatternFormatteroperator= (PatternFormatter const &other)=delete
 
PatternFormatteroperator= (PatternFormatter &&other) noexcept=default
 
 PatternFormatter (PatternFormatter &&other) noexcept=default
 
QUILL_NODISCARD QUILL_ATTRIBUTE_HOT std::string_view format (uint64_t timestamp, std::string_view thread_id, std::string_view thread_name, std::string_view process_id, std::string_view logger, std::string_view log_level_description, std::string_view log_level_short_code, MacroMetadata const &log_statement_metadata, std::vector< std::pair< std::string, std::string >> const *named_args, std::string_view log_msg)
 
QUILL_NODISCARD PatternFormatterOptions const & get_options () const noexcept
 

Static Protected Member Functions

static QUILL_NODISCARD std::string_view _process_source_location_path (std::string_view source_location, std::string const &strip_prefix, bool remove_relative_paths)
 

Member Enumeration Documentation

◆ TimestampPrecision

enum PatternFormatter::TimestampPrecision : uint8_t
strong

Public classes.

Stores the precision of the timestamp

Constructor & Destructor Documentation

◆ PatternFormatter()

PatternFormatter::PatternFormatter ( PatternFormatterOptions  options)
inlineexplicit

Main PatternFormatter class.

Constructor for a PatternFormatter with custom formatting options.

Parameters
optionsThe PatternFormatterOptions object containing the formatting configuration.
See also
PatternFormatterOptions for detailed information on available options.
Exceptions
std::invalid_argumentif the format string in options is invalid

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