-
Added
DeferredFormatCodec
andDirectFormatCodec
for easier logging of user-defined types and smoother migration from pre-v4
versions. Previously, users had to define a customCodec
for every non-trivially copyable user-defined type they wanted to log.template <> struct quill::Codec<UserTypeA> : quill::DeferredFormatCodec<UserTypeA> { }; template <> struct quill::Codec<UserTypeB> : quill::DirectFormatCodec<UserTypeB> { };
DeferredFormatCodec
now supports both trivially and non-trivially copyable types:- For trivially copyable types, it behaves the same as
TriviallyCopyableTypeCodec
. - For non-trivially copyable types, it works similarly to pre-
v4
by taking a copy of the object using the copy constructor and placement new.
- For trivially copyable types, it behaves the same as
DirectFormatCodec
formats the object immediately in the hot path, serving as a shortcut to explicitly formatting the object when logging.- For advanced use cases, a custom
Codec
can still be defined for finer control over encoding/decoding.
See:
-
Added support for C-style arrays of user-defined types in
std/Array.h
-
Fixed warnings:
-Wimplicit-int-float-conversion
,-Wfloat-equal
, and-Wdocumentation
. -
Marked
TriviallyCopyableTypeCodec
as deprecated.DeferredFormatCodec
should be used instead, requiring no further changes. -
Raised minimum
CMake
required version from3.8
to3.10
to avoid deprecation warnings.