#pragma once #include "lib/utils/warn_ctrl.h" #include "Common.h" #include "MsgPacking.h" namespace bts { namespace log { using ArgUnpacker = std::string (*) (ArgBuffer const&b, const char*msg_template); GCC_DIAG_OFF("-Weffc++") struct LogRec { uint64_t ts; const char *file; const char *msg_template; ArgUnpacker unpacker; uint16_t line; Level level; Subsystem subsystem; ArgBuffer args; template void pack_msg (const char *msg_t, Args&&... msg_args) { msg_template = msg_t; unpacker = unpack_msg_args::type...>; pack_msg_args(args,std::forward(msg_args)...); } std::string unpack_msg() { return unpacker(args,msg_template); } }; GCC_DIAG_RESTORE() #ifndef WIN32 //static_assert(sizeof(LogRec) == 256, "LogRec should be 128 bytes"); #endif }}