v7.0.0
版本发布时间: 2024-09-06 06:50:45
odygrd/quill最新发布版本:v7.0.0(2024-09-06 06:50:45)
-
Simplified the log tags API. The
Tags
class has been removed. You now pass achar const*
directly to the macros. Additionally, macros previously namedWITH_TAGS
have been renamed to_TAGS
. For example,LOG_INFO_WITH_TAGS
is nowLOG_INFO_TAGS
. -
Renamed
backend_cpu_affinity
tocpu_affinity
inBackendOptions
to improve consistency. -
Simplified project structure by removing the extra quill directory and made minor CMake improvements;
include/quill
is now directly in the root. -
Added support for
std::string
with custom allocator. (#524) -
Added a new log level
NOTICE
, for capturing significant events that aren't errors or warnings. It fits betweenINFO
andWARNING
for logging important runtime events that require attention. (#526) -
Enhanced static assert error message for unsupported codecs, providing clearer guidance for STL and user-defined types.
-
Improved frontend performance by caching the
ThreadContext
pointer inLogger
class to avoid repeated function calls. On Linux, this is now further optimised with__thread
for thread-local storage, while other platforms still usethread_local
. -
Minor performance enhancement in the frontend by replacing
std::vector<size_t>
with anInlinedVector<uint32_t, 12>
for caching sizes (e.g. string arguments). -
Fixed order of evaluation for
Codec::pair<T1,T2>::compute_encoded_size()
to prevent side effects observed on MSVC -
Introduced the
add_metadata_to_multi_line_logs
option inPatternFormatter
. This option, now enabled by default, appends metadata such as timestamps and log levels to every line of multiline log entries, ensuring consistent log output. To restore the previous behavior, set this option to false when creating aLogger
usingFrontend::create_or_get_logger(...)
. Note that this option is ignored when logging JSON using named arguments in the format message. (#534) -
JSON
sinks now automatically remove any\n
characters from format messages, ensuring the emission of validJSON
messages even when\n
is present in the format. -
Replaced
static
variables withstatic constexpr
in theConsoleColours
class. -
Fixed compiler errors in a few rarely used macros. Added a comprehensive test for all macros to prevent similar issues in the future.
-
Expanded terminal list for color detection in console applications on Linux
-
Fixed an issue where
char*
andchar[]
types could be incorrectly selected by the Codec template inArray.h
-
The library no longer defines
__STDC_WANT_LIB_EXT1__
, as the bounds-checking functions from the extensions are no longer needed. -
StringFromTime
constructor no longer relies on the system's current time, improving performance in simulations where timestamps differ from system time. (#541) -
The
Frontend::create_or_get_logger(...)
function now accepts aPatternFormatterOptions
parameter, simplifying the API. This is a breaking change. To migrate quickly, wrap the existing formatting parameters in aPatternFormatterOptions
object.Before:
quill::Logger* logger = quill::Frontend::create_or_get_logger("root", std::move(file_sink), "%(time) [%(thread_id)] %(short_source_location:<28) " "LOG_%(log_level:<9) %(logger:<12) %(message)", "%H:%M:%S.%Qns", quill::Timezone::GmtTime);
After:
quill::Logger* logger = quill::Frontend::create_or_get_logger("root", std::move(file_sink), quill::PatternFormatterOptions { "%(time) [%(thread_id)] %(short_source_location:<28) " "LOG_%(log_level:<9) %(logger:<12) %(message)", "%H:%M:%S.%Qns", quill::Timezone::GmtTime});
1、 quill-7.0.0.zip 2.79MB