Skip to content

v8.2.0

Latest
Compare
Choose a tag to compare
@odygrd odygrd released this 22 Feb 14:19
· 25 commits to master since this release
  • Added DeferredFormatCodec and DirectFormatCodec for easier logging of user-defined types and smoother migration from pre-v4 versions. Previously, users had to define a custom Codec 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.
    • 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 from 3.8 to 3.10 to avoid deprecation warnings.