Skip to content

v6.0.0

Compare
Choose a tag to compare
@odygrd odygrd released this 27 Jul 12:56
· 182 commits to master since this release
  • Added a Cheat Sheet to help users get the most out of the logging library

  • Removed ArgSizeCalculator<>, Encoder<>, and Decoder<> classes. These have been consolidated into a single Codec class. Users who wish to pass user-defined objects should now specialize this single Codec class instead of managing three separate classes. For guidance, please refer to the updated advanced example

  • Added TriviallyCopyableCodec.h to facilitate serialization for trivially copyable user-defined types. For example

      struct TCStruct
      {
        int a;
        double b;
        char c[12];
        
        friend std::ostream& operator<<(std::ostream& os, TCStruct const& arg)
        {
          os << "a: " << arg.a << ", b: " << arg.b << ", c: " << arg.c;
          return os;
        }
      };
      
      template <>
      struct fmtquill::formatter<TCStruct> : fmtquill::ostream_formatter
      {
      };
      
      template <>
      struct quill::Codec<TCStruct> : quill::TriviallyCopyableTypeCodec<TCStruct>
      {
      };
      
      int main()
      {
        // init code ...
        
        TCStruct tc;
        tc.a = 123;
        tc.b = 321;
        tc.c[0] = '\0';
        LOG_INFO(logger, "{}", tc);
      }
  • Added support for passing arithmetic or enum c style arrays when std/Array.h is included. For example

      #include "quill/std/Array.h"
    
      int a[6] = {123, 456};
      LOG_INFO(logger, "a {}", a);
  • Added support for void const* formatting. For example

        int a = 123;
        int* b = &a;
        LOG_INFO(logger, "{}", fmt::ptr(b));
  • Added support for formatting std::chrono::time_point and std::chrono::duration with the inclusion
    of quill/std/Chrono.h

    #include "quill/std/Chrono.h"
    
    std::chrono::system_clock::time_point now = std::chrono::system_clock::now();
    LOG_INFO(logger, "time is {}", now);
  • Removed unused method from ConsoleSink