|
QUILL_ATTRIBUTE_HOT void | write_log (MacroMetadata const *log_metadata, uint64_t log_timestamp, std::string_view thread_id, std::string_view thread_name, std::string const &process_id, std::string_view logger_name, LogLevel log_level, std::string_view log_level_description, std::string_view log_level_short_code, std::vector< std::pair< std::string, std::string >> const *named_args, std::string_view log_message, std::string_view log_statement) override |
| Logs a formatted log message to the sink. More...
|
|
virtual QUILL_ATTRIBUTE_HOT void | generate_json_message (MacroMetadata const *log_metadata, uint64_t log_timestamp, std::string_view thread_id, std::string_view, std::string const &, std::string_view logger_name, LogLevel, std::string_view log_level_description, std::string_view, std::vector< std::pair< std::string, std::string >> const *named_args, std::string_view, std::string_view, char const *message_format) |
| Generates a JSON-formatted log message. More...
|
|
|
fmtquill::memory_buffer | _json_message |
|
std::string | _format |
|
◆ generate_json_message()
template<typename TBase>
virtual QUILL_ATTRIBUTE_HOT void detail::JsonSink< TBase >::generate_json_message |
( |
MacroMetadata const * |
log_metadata, |
|
|
uint64_t |
log_timestamp, |
|
|
std::string_view |
thread_id, |
|
|
std::string_view |
, |
|
|
std::string const & |
, |
|
|
std::string_view |
logger_name, |
|
|
LogLevel |
, |
|
|
std::string_view |
log_level_description, |
|
|
std::string_view |
, |
|
|
std::vector< std::pair< std::string, std::string >> const * |
named_args, |
|
|
std::string_view |
, |
|
|
std::string_view |
, |
|
|
char const * |
message_format |
|
) |
| |
|
inlinevirtual |
Generates a JSON-formatted log message.
This function creates the default JSON structure for log messages, including the timestamp, file name, line number, thread information, logger name, log level, and message content.
It is designed to be customizable by overriding in derived classes. Users can provide their own implementation to generate a log message in a custom format or to include additional fields.
◆ write_log()
template<typename TBase>
QUILL_ATTRIBUTE_HOT void detail::JsonSink< TBase >::write_log |
( |
MacroMetadata const * |
log_metadata, |
|
|
uint64_t |
log_timestamp, |
|
|
std::string_view |
thread_id, |
|
|
std::string_view |
thread_name, |
|
|
std::string const & |
process_id, |
|
|
std::string_view |
logger_name, |
|
|
LogLevel |
log_level, |
|
|
std::string_view |
log_level_description, |
|
|
std::string_view |
log_level_short_code, |
|
|
std::vector< std::pair< std::string, std::string >> const * |
named_args, |
|
|
std::string_view |
log_message, |
|
|
std::string_view |
log_statement |
|
) |
| |
|
inlineoverride |
Logs a formatted log message to the sink.
- Note
- Accessor for backend processing.
- Parameters
-
log_metadata | Pointer to the macro metadata. |
log_timestamp | Timestamp of the log event. |
thread_id | ID of the thread. |
thread_name | Name of the thread. |
process_id | Process Id |
logger_name | Name of the logger. |
log_level | Log level of the message. |
log_level_description | Description of the log level. |
log_level_short_code | Short code representing the log level. |
named_args | Vector of key-value pairs of named args |
log_message | log message |
log_statement | log statement |
The documentation for this class was generated from the following file: