quill
PatternFormatterOptions.h
1 
7 #pragma once
8 
9 #include "quill/core/Attributes.h"
10 #include "quill/core/Common.h"
11 
12 #include <limits>
13 #include <string>
14 
15 QUILL_BEGIN_NAMESPACE
16 
24 {
25 public:
26  /***/
27  explicit PatternFormatterOptions(std::string format_pattern =
28  "%(time) [%(thread_id)] %(short_source_location:<28) "
29  "LOG_%(log_level:<9) %(logger:<12) %(message)",
30  std::string timestamp_pattern = "%H:%M:%S.%Qns",
31  Timezone timestamp_timezone = Timezone::LocalTime,
33  : format_pattern(static_cast<std::string&&>(format_pattern)),
34  timestamp_pattern(static_cast<std::string&&>(timestamp_pattern)),
37  {
38  }
39 
66  std::string format_pattern{
67  "%(time) [%(thread_id)] %(short_source_location:<28) LOG_%(log_level:<9) %(logger:<12) "
68  "%(message)"};
69 
79  std::string timestamp_pattern{"%H:%M:%S.%Qns"};
80 
92 
110  std::string_view (*process_function_name)(char const*){nullptr};
111 
117  Timezone timestamp_timezone{Timezone::LocalTime};
118 
127 
137 
138  /***/
139  bool operator==(PatternFormatterOptions const& other) const noexcept
140  {
146  }
147 
148  /***/
149  bool operator!=(PatternFormatterOptions const& other) const noexcept { return !(*this == other); }
150 };
151 
152 QUILL_END_NAMESPACE
std::string timestamp_pattern
The format pattern for timestamps.
Definition: PatternFormatterOptions.h:79
Timezone timestamp_timezone
The timezone to use for timestamps.
Definition: PatternFormatterOptions.h:117
bool add_metadata_to_multi_line_logs
Whether to add metadata to each line of multi-line log messages.
Definition: PatternFormatterOptions.h:126
Configuration options for the PatternFormatter.
Definition: PatternFormatterOptions.h:23
std::string_view(* process_function_name)(char const *)
Function pointer for custom processing of detailed function names for %(caller_function) ...
Definition: PatternFormatterOptions.h:110
bool source_location_remove_relative_paths
Whether to remove relative path components from source location paths.
Definition: PatternFormatterOptions.h:136
std::string format_pattern
The format pattern for log messages.
Definition: PatternFormatterOptions.h:66
std::string source_location_path_strip_prefix
Sets a path prefix to be stripped from source location paths.
Definition: PatternFormatterOptions.h:91