quill
Public Member Functions | Public Attributes | List of all members
User Class Reference

This example showcases passing user-defined types as arguments to the logger, with their formatting deferred asynchronously to the backend. More...

Public Member Functions

 User (std::string name, std::string surname, uint32_t age)
 
 User (std::string name, std::string surname, uint32_t age)
 

Public Attributes

std::string name
 
std::string surname
 
uint32_t age {}
 
std::array< std::string, 3 > favorite_colors
 
std::vector< std::string > favorite_colors
 
uint64_t * value_ptr {nullptr}
 

Detailed Description

This example showcases passing user-defined types as arguments to the logger, with their formatting deferred asynchronously to the backend.

This example shows the QUILL_LOGGABLE_DIRECT_FORMAT and QUILL_LOGGABLE_DEFERRED_FORMAT helper macros for user-defined types.

This example shows direct formatting of a user-defined type on the hot path using quill::DirectFormatCodec<T>.

This example shows deferred formatting of a whole user-defined object using fmtquill::formatter<T> together with quill::DeferredFormatCodec<T>.

It's particularly useful in scenarios where string formatting latency is unacceptable and the code operates on the critical path. User defined type

Example of an UNSAFE type for asynchronous logging

This class contains a pointer member which makes it unsafe for asynchronous formatting (the pointer may become invalid).

Note: Quill handles standard types and strings, and other STL containers safely without additional configuration.

Helper macros are only needed to enable custom user-defined types that contain unsafe members like raw pointers or references.


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