Repository navigation
Breaking Changes
-
With C++20, the
const char[N]format string of a macro-free call such asquill::info()must be
a string literal or aconstexprarray with static storage, so a local array no longer compiles:char const fmt[] = "Request {}"; quill::info(logger, +fmt, id); // was quill::info(logger, fmt, id) // or alternatively: quill::info(logger, &fmt[0], id);
-
GCC 8 is the oldest supported GCC. The
<experimental/filesystem>fallback for GCC 7, which no
longer compiled, is removed with theQUILL_HAS_FILESYSTEMand
QUILL_HAS_EXPERIMENTAL_FILESYSTEMmacros. -
Sink::write_log(),Sink::write_metric(),Filter::filter()and the protected
StreamSink::estimate_write_size()take a singleLogRecordorMetricRecord, and a custom JSON
sink overridesgenerate_json_message(LogRecord const& record, char const* message_format). Sinks
implement oneflush_sink(SinkFlushReason), and record fields added later will not break custom
sinks and filters again. -
Logger creation takes its clock as
ClockSource::tsc(),ClockSource::system()or
ClockSource::custom(clock), in place of theClockSourceTypeandUserClockSource*arguments. -
loglevel_from_string()is renamed tolog_level_from_string(). -
UserClockSource::now()isnoexcept. Addnoexceptto existing overrides and keep them free of
Quill logging calls, since they run while a record occupies the calling thread's queue. -
Custom frontend options must derive from
quill::FrontendOptions; a standalone struct no longer
compiles. Options added in later versions are then inherited. -
QUILL_ENABLE_IMMEDIATE_FLUSHis no longer read: to compile out the immediate-flush check, set
enable_immediate_flush = falsein custom frontend options instead of defining
QUILL_ENABLE_IMMEDIATE_FLUSH=0.Logger::log_statement()andlog_statement_runtime_metadata()
no longer take the flag as a template argument, and CSV and signal-handler messages follow the
logger's flush policy. -
FileSinkConfig::set_open_mode()throwsQuillErrorfor modes other than"a"and"w"(or
"ab"and"wb"), which previously failed to open on POSIX or, for"r+"on Windows, overwrote
the file from its start. -
Custom codecs use
quill::SizeCacheVectorinstead ofquill::detail::SizeCacheVector, whose
assign()is removed; no Quill codec used it. -
The protected
FileSinkhelpersformat_datetime_string()andappend_datetime_to_filename()
are free functions inquill::detail, andextract_stem_and_extension()is removed: use
path.parent_path() / path.stem()andpath.extension(). The protected
JsonSink::_append_json_escaped()is renamed toappend_json_escaped(). -
The protected
FileSink::open_file(),close_file()andfsync_file()returnbool, which is
falsewhen the call failed in aQUILL_NO_EXCEPTIONSbuild. A class derived fromFileSink
that hides them must returnbooltoo, to be the base of aRotatingSink. -
Custom sinks that derive from
RotatingSinkand use its protected list of rotated files,
_created_files, now get astd::vectorinstead of astd::deque. -
Removed
ConsoleSinkConfig::Colours::set_colours_enabled()andcolours_enabled(), which had no
effect, andPrometheusSink::Options, which no constructor accepted. Use
ConsoleSinkConfig::set_colour_mode()to disable colours. -
LoggerBase::mark_invalid()is now protected; remove loggers withFrontend::remove_logger()or
Frontend::remove_logger_blocking(). The unused macrosQUILL_CPLUSPLUS,QUILL_HAS_INCLUDE,
QUILL_HAS_CPP_ATTRIBUTEandQUILL_MAGIC_SEPARATORare removed.
API and Behaviour Changes
- Quill's own CMake, Meson and Bazel builds, e.g. of its tests and examples, use C++20 when no
standard is set, and projects that add Quill keep their own standard. C++17 is still supported:
setCMAKE_CXX_STANDARD=17,cpp_std=c++17or--cxxopt=-std=c++17. - With a
BackendOptions::sleep_durationof 0, the backend now pauses for
BackendOptions::spin_wait_duration, 10 μs by default, each time it finds every queue empty,
which lowers the latency of the logging threads. Set it to 0 to read the queues again without a
pause. - Each record in a frontend queue is padded to a multiple of 8 bytes, so a bounded queue holds
fewer of the records whose size was not one already before it blocks or drops, e.g. about a
tenth fewer of a statement with oneintor one short string argument. - With Clang, an untagged macro-free call that spans several lines can report the line of its
format string. - On Windows, a blocked producer using a
BoundedBlockingorUnboundedBlockingqueue yields
between retries whenFrontendOptions::blocking_queue_retry_interval_nsis below 1 ms
(800 ns by default). The previousSleep()calls cut throughput by about two thirds when a
producer filled its queue. BackendOptions::sleep_durationdefaults to 500 μs instead of 100 μs, and to 10 ms on Android,
so an idle backend thread wakes up less often on a shared core and on battery-powered devices. A
record logged while the backend sleeps reaches the sinks when it wakes up, or at once after
Backend::notify().- Creating loggers whose
FrontendOptionsvalues differ throwsQuillError, as does passing
options with other values toBackend::start<TFrontendOptions>()withSignalHandlerOptionsor,
on Windows, toinit_signal_handler<TFrontendOptions>(). Mixing queue types previously crashed on
the first log call from a thread that used both loggers. Frontend::create_sink<TSink>()andFrontend::create_or_get_sink<TSink>()return
std::shared_ptr<TSink>, so configuring the created sink no longer needs a cast. Code that
relied on both returningstd::shared_ptr<Sink>, such as a conditional expression that selects
between two sink types, needs an explicit conversion.FileSinkbuffers records in a write buffer of its own on every platform, as it already did on
Windows, by default 64 KiB, or 256 KiB on Windows, where it was 64 KiB. Pass0to
FileSinkConfig::set_write_buffer_size()to write each record through the handle that the
FileEventNotifiercallbacks receive, e.g. to buffer it withsetvbuf(); on Windows0used to
select the default size.- When a write to the file fails, e.g. on a full disk, a
FileSinkkeeps the records in its write
buffer, and the rest of a record larger than the buffer, and writes them once a later write
succeeds, unless aRotatingFileSinkrotates the file in the meantime; on Linux and macOS the C
library could discard them. CsvWriter(filename)appends by default instead of truncating the file. Pass'w'to truncate
an existing file.- With a
RotatingFileSinkConfig, the header of aCsvWritercounts towards
rotation_max_file_sizein every file, and a time rotation skips a file that was opened empty
and holds only the header. - A
CsvWriterwithshould_write_header=truethrowsQuillErrorwhen its file already has a
sink that does not write that header, e.g. the one of a writer withshould_write_header=false.
Create the writer that writes the header first. - A
RotatingFileSinkthrowsQuillErrorwhen its startup cleanup or recovery needs to list the
directory of its file and cannot, e.g. one that the process may write to but not read. Before,
it was created with rotation disabled and wrote one file without a size limit. - With open mode
'a', aRotatingFileSinkrecovers the backups of an earlier run only when their
names are spelled as the configured file name, also on a filesystem that ignores case or Unicode
normalization. Withset_overwrite_rolled_files(false), a rotation no longer renames a file over
a backup that the sink does not track: the sink keeps writing to its current file instead. - A timestamp pattern that repeats
%Qms,%Qusor%Qns, such as"%S.%Qms %Qms", is rejected
like one that mixes them: the logger's records are not written and the error is reported through
BackendOptions::error_notifier, and inQUILL_NO_EXCEPTIONSbuilds the process aborts. Before,
the repeated specifier was printed as written on Linux and failed every record on Windows. - In
QUILL_NO_EXCEPTIONSbuilds, an I/O failure of aFileSink,RotatingFileSink,StreamSink
orSystemdSinkon the backend thread, such as a full disk or a log directory that was removed,
andLOG_BACKTRACEwithoutinit_backtrace(), are reported through
BackendOptions::error_notifierinstead of ending the process. A sink that cannot open its file
when it is created still ends the process. Frontend::get_valid_logger()is no longernoexcept: for a logger created with another
FrontendOptionstype it throwsQuillError, asget_logger()does, instead of calling
std::terminate().- On POSIX, with the built-in signal handler, Ctrl-C and
SIGTERMstill flush the logs but now
terminate the process by the signal, so shell loops and supervisors see the interruption. As PID 1
of a container, where the kernel ignores that signal, the process exits with status
128 + signal. SIGBUSis one of the defaultSignalHandlerOptions::catchable_signals, andBackend::stop()
restores the signal handlers installed beforeBackend::start()instead of resetting them to the
default.- File sinks on POSIX create files with permissions from the process umask, as
fopen()does,
instead of always 0644. - With the default
Registry::InsertBehavior::Merge,PrometheusSink::unregister_metric()leaves a
family in the registry when it removes its last series, as the application may hold the same
family, which it lost before. Registering that name again with another metric type or other
constant labels then throws. - An unbounded queue that cannot grow because memory is exhausted blocks or drops the message like
a full queue, instead of throwing from theLOG_*call. A message or MDC update too large for the
current queue is then dropped and reported separately throughBackendOptions::error_notifier. - Logging and metric calls take the timestamp of a record immediately before publishing it, so a
call that copies a large payload or waits for queue space records the time after that work. - The backend reports through
BackendOptions::error_notifierwhen it writes a record out of
timestamp order, e.g. one that a delayed thread published after a newer record of another thread,
and suggests a largerlog_timestamp_ordering_grace_period. It reports again only when it would
suggest a larger value. - A custom
BackendOptions::check_printable_charis called once per byte value when the backend
starts instead of once per character, so it must depend only on its argument. - Logger patterns with a
}inside an attribute's format spec, such as%(logger:}), are rejected
as an invalid format specifier instead of printing a literal}; put the}after the attribute. quill/std/Atomic.hno longer includesquill/bundled/fmt/format.hand
quill/bundled/fmt/std.h; include them directly if your code relied on that.
New Features
- Added
LOG_BINARY(logger, data, size)andLogger::log_binary(), which write bytes to the sinks
of a logger as they are, e.g. to record a network or sensor feed to aFileSinkor
RotatingFileSink. Custom sinks receive the bytes in the new
Sink::write_binary(BinaryRecord const&). - Added
quill::BinaryWriter, which writes binary records withwriter.write(data, size)to a
file, a rotating file or custom sinks, andquill::PcapWriter, which writes captures that
Wireshark and tcpdump can read, each rotated file a self-contained capture. The signal handler
skips their loggers by default, through"__binary__"in
SignalHandlerOptions::excluded_logger_substrings. - Added
FileSinkConfig::set_binary_record_framing(), which makes a file sink write the size of
each binary record, or its timestamp and size, before its bytes, so that a reader can tell
records of different sizes apart. - Added
FileSinkConfig::set_file_header(), which starts every file of aFileSinkor
RotatingFileSinkwith the given bytes, including each file a rotation creates, e.g. a CSV
header row or the global header of a pcap file. - Added
FrontendOptions::clock_type, which defaults toClockSourcefor runtime selection and can
name aUserClockSourceimplementation so that the frontend inlines its timestamp reads. The
CsvWriterconstructors take the clock as a last argument, for frontend options with a
clock_type. (#1009) - Added
UserClockSource::timestamp_type(): a clock that follows real time, such as a PTP or NIC
clock, returnsTimestampType::WallClockNanoseconds, so its records wait for the grace period and
are ordered with the other loggers likeClockSource::system(). A clock of raw TSC ticks returns
TscTicks, and the defaultEpochNanosecondsis for simulated or replayed time. - Added
std::filesystem::pathoverloads ofFrontend::create_sink<TSink>(),
Frontend::create_or_get_sink<TSink>()andFrontend::get_sink()for file sinks, and of the
constructors ofCsvWriter,BinaryWriterandPcapWriter, so Windows applications can log to
paths with characters outside the active code page.
(#354) ConsoleSinkhonours theNO_COLORenvironment variable: with the default
ColourMode::Automaticit writes no colours when the variable has a value, while
ColourMode::Alwaysstill writes them.- Added
quill::MemberwiseCodec<T, &T::a, &T::b>, which generates a codec from a list of data
members. - Added
PatternFormatter::format(LogRecord const&)for custom sinks that format records. - Added a
MacroMetadataconstructor that takes the source location and the format string as
std::string_view, for metadata that an application builds at run time fromstd::strings, e.g.
forLogger::log_statement(), so that their lengths are not measured again. - Added
FileSink::config(), which returns theFileSinkConfigthat the sink was created with. BackendOptionsis an aggregate in every language standard, so C++20 designated initializers
such asBackendOptions{.thread_name = "backend"}compile.- Added
QUILL_VERSION,QUILL_VERSION_MAJOR,QUILL_VERSION_MINORandQUILL_VERSION_PATCH. - Updated bundled
libfmttov12.2.1.
Performance
- Increased backend throughput, in formatting log messages for every sink and in writing to
FileSink,JsonFileSinkandJsonConsoleSink, including structured logging with named
arguments and records from the macro-free logging functions. - Faster
PatternFormatterformatting of the default pattern, of patterns that pad or truncate
ASCII attribute values, such as%(logger:<10.10), and of%(source_location)with
source_location_path_strip_prefixorsource_location_remove_relative_paths. - The backend's cost per record grows far less with the number of idle logging threads.
- Reduced idle backend CPU use, and contention with frontend logger lookups, in applications with
many loggers and sinks. - Reduced the cost of reading the system and user clocks and of checking string arguments with the
defaultBackendOptions::check_printable_char. On x86, the TSC clock calibrates in 10 ms instead
of busy-spinning for about 50 ms. - Reduced the cost of logging C strings,
std::vectors of arithmetic values,std::forward_list
values andstd::bitsets of more than 64 bits, which the logging thread no longer encodes bit by
bit. DYNAMIC_METRIC()andLogger::publish_dynamic_metric()with an inline label list, such as
{{"method", method}, {"status", "200"}}, no longer allocate astd::vectorand astd::string
for each label on every call.Logger::flush_log()andFrontend::remove_logger_blocking()return much sooner once the backend
has handled the request, as they yield before they sleep. Each used to wait at least the shortest
sleep the OS allows, also for every flush thatLogger::set_immediate_flush()requests.- A
ConsoleSinkwith colours writes each record in one call instead of four, which on an
unbuffered stream such asstderris one system call per record, and on Windows keeps the output
of other writers from landing between a colour code and its reset. - Growing an unbounded queue no longer stalls the log call that triggers it while the whole new
buffer is written, and the unused part of the buffer no longer takes up resident memory. - Source files that use
LOG_*typically compile in roughly 25–33% less time with GCC, Clang and
MSVC, with the largest gains in files with few log statements. These statements also generate
less code with Clang and with MSVC at/O2. - Smaller binaries with GCC when
LOG_*statements with the same argument types, orMETRIC, are
used in many source files, or when one source file logs many combinations of argument types. - Reduced the compile time and code size of the source file that starts the backend and creates the
sinks, more so with aRotatingFileSink. - Reduced the latency of logging
std::string,std::string_viewand C string arguments of up to
64 bytes with GCC and Clang, where the logging thread now copies them without callingmemcpy. - Log statements whose record takes more than 256 bytes of the queue, such as one with a
std::vector<std::string>, request the record's cache lines before writing it, which lowers their
latency, most with the default 128 KiB queue. - With C++20, a macro-free call with a string literal format string and no tags, such as
quill::info(logger, "Request {} done", id), no longer copies the format string on every call,
which brings it close toLOG_INFOon the logging thread, and the backend writes these records
faster.
Bug Fixes
Frontend::remove_logger_blocking()andCsvWriter::close()return, and the queues of exited
threads are freed, while other threads keep logging with advancing timestamps. Both used to wait
for every queue to be empty at once, so short-lived threads grew the memory of an application
that logs continuously.- The backend keeps writing a backlog while new threads start logging. Before, an application that
starts a few thousand short-lived logging threads per second could stop writing after a slow sink
delayed the backend for a few seconds, with memory growing until it stopped logging. - A transient allocation failure on the backend thread is reported through
BackendOptions::error_notifierand retried, instead of terminating the process, writing a
record with duplicated arguments, disabling a sink's filters or truncating%(mdc). An argument
of a type usingDeferredFormatCodecis then no longer formatted from an object that was already
destroyed, and a logger removed meanwhile is still released, where
Frontend::remove_logger_blocking()never returned. Frontend::create_or_get_sink()andFrontend::get_sink()find aFileSinkalso through a
symlink to the file it created, by the name of its file with the date or time suffix of
FileSinkConfig::set_filename_append_option(), and on Windows by another spelling, such as
app.log.forapp.logor, with MinGW, a directory in another case. Before, a second sink could
open the same file and truncate it in'w'mode.Frontend::preallocate()can be called again by a thread that has already logged, e.g. at the
start of each job of a thread pool. With an unbounded queue it read memory that the backend
thread could be freeing.- The signal handler flushes the sinks of an application whose only loggers are those of
CsvWriters, so rows not yet flushed are no longer lost onSIGINT,SIGTERMor a crash. Backend::stop()andManualBackendWorker::shutdown()destroy the callables of
BackendOptions, such aserror_notifier, and free the memory that the backend grew for MDC
fields and dynamic metric labels. A shared library that provides the callables can then be
unloaded, and an application that keeps running without the backend no longer holds the memory.Logger::flush_log()also flushes the sinks of loggers that wait to be removed.Logger::flush_log()andFrontend::remove_logger_blocking()return at once when no backend is
running: beforeBackend::start(), afterBackend::stop(), or in a DLL or shared library with
its own copy of Quill. Before, they waited forever. The flushes ofset_immediate_flush()are
skipped in the same way, and the records stay queued until a backend starts.Frontend::remove_logger_blocking()returns when a backend started later removes the logger, also
if the backend that read its request stopped before removing it, e.g. with
BackendOptions::wait_for_queues_to_empty_before_exit = false. Before, the call waited forever.- The backend thread sleeps while records wait for
log_timestamp_ordering_grace_periodinstead of
using a full core, e.g. while a thread logs at a steady high rate, unlesssleep_durationis 0. BackendOptions::sleep_duration = std::chrono::nanoseconds::max()sleeps until
Backend::notify()wakes the backend, or for at most 24 hours, instead of busy-spinning.- With
BackendOptions::ensure_monotonic_output_timestamps, the records of a logger with a custom
epoch clock, such as the time of a simulation, keep their timestamps when another logger uses
wall time, instead of taking the wall time of the other logger's last record. - On Windows, a
ConsoleSinkin a process without a console, such as a GUI application or a
service, discards its output, unless its standard handle is redirected, e.g. to a file. Before,
every record was reported as a failed write, and the C runtime could end the process for an
invalid file descriptor. - On Windows, a
FileSinkin append mode can write to a pipe or a device, whichWriteFile
rejected with the end-of-file offset that a file on disk takes. - On Windows, an unhandled-exception filter installed before
Backend::start(), such as a crash
reporter, runs again after Quill's filter. - With the built-in signal handler, a second handled signal on the thread that is already handling
one, such asSIGINTduringSIGTERM, no longer stalls the shutdown until the handler timeout,
andSignalHandlerOptions::timeout_seconds = 0leaves the application'sSIGALRMhandler
installed. - When
Backend::start()cannot open its lock file in/tmp, outside Windows and Android, e.g.
because/tmpis read-only or holds a stale lock file of another user, it skips the
BackendOptions::check_backend_singleton_instancecheck at once instead of after 200 ms of
retries. - A
CsvWriterdefined at namespace scope gets the__csv__logger name prefix in GCC builds, so
the signal handler no longer writes its messages to the CSV file. - A
CsvWritercreated with a sink no longer leaves its logger registered when its constructor
throws, e.g. for a header larger than aBoundedBlockingqueue. Closing oneCsvWriterno longer
breaks another one with a different schema that writes to the same file, or one with the same
name in another shared library. - Builds with assertions enabled no longer abort when the system clock is set between a log call
and the backend reading the record, e.g. from 1970 to the current time on a device that starts
without a clock. - With the TSC clock, timestamps keep following the system clock on hosts where reading it is slow,
and drift less between resyncs. On ARM64, a resync sample that an interrupt delays is taken again,
where with the 24 MHz counter of e.g. Apple Silicon it could shift timestamps by about 1 ms. - With
HugePagesPolicy::AlwaysorTry, a queue of 1 MiB or more no longer requests one huge page
too many, so a hugetlb pool sized from the queue capacity is enough. - Logging more than 12 C strings in one statement, or a container of them, throws
std::bad_alloc
from the log call when the size cache cannot allocate, instead of callingstd::terminate(). - A
MacroMetadatathat an application builds forLogger::log_statement()can have a source
location with a Windows drive and no line, such as"C:\\src\\file.cpp". Before,
%(file_name)read past the end of it. - With Clang and
-Wpedantic, the log macros no longer report
-Wgnu-zero-variadic-macro-argumentsin an application that is built without the compile
options of the Quill CMake, Meson or Bazel target. - With GCC and
-Wshadow, a source file that includesquill/Logger.hno longer reports shadowed
members ofPatternFormatterOptions, and the Quill headers build without warnings under
-Wsign-conversionand-Wextra-semiin an application that enables them for its own code. - A type using
DirectFormatCodecis formatted once per log statement instead of twice, so a
formatter that reads concurrently changing state can no longer log truncated or stale text. - Format strings that combine a dynamic width or precision with named arguments, such as
"{:{}} {unit}", no longer fail with "argument not found". Arguments beyond the named fields get
unique keys inLogRecord::named_argsand JSON output, soLOG_INFO(logger, "{_1}", 31, 42)no
longer emits the key_1twice. - Timestamp patterns with a flagged time specifier such as
%-Hor%_Mprint the current time
instead of a stale cached one,%Xand%care accepted instead of throwingQuillError, and
%rfollows the locale instead of always printing%I:%M:%S %p, except with MinGW and the legacy
MSVCRT, which has no%r. Such patterns are formatted withstrftime()for every timestamp,
whichBackendOptions::error_notifierreports once. - Windows builds, including MinGW ones, report a formatting error for a timestamp or file name
pattern with a specifier the C runtime does not support, such as%-H, instead of terminating
the process. - A
%sin the file name pattern ofFileSinkConfig::set_filename_append_option()gives the epoch
seconds withTimezone::GmtTimetoo, where it was shifted by the local UTC offset, and is
accepted on Windows. - The time at the start of the backend's
error_notifiermessages isHH:MM:SSin every locale,
where a locale with a long%Xcould add unrelated bytes to it. %(thread_name)shows thread names longer than 15 characters in full on macOS, and thread
descriptions longer than 256 UTF-16 code units in full on Windows, where they were cut, possibly
inside a character. On macOS, aBackendOptions::thread_nameof 64 bytes or more is truncated to
63, as it is to 15 on Linux, instead of leaving the backend thread unnamed, and on NetBSD a%
in it is no longer read as a printf conversion.- On Cygwin,
%(process_id)shows the id of the process instead of 0. log_level_from_string()and theQUILL_LOG_LEVELenvironment variable accept upper-case
names such asINFOunder a Turkish or Azerbaijani locale, where they threwQuillError.- In
QUILL_NO_EXCEPTIONSbuilds,Frontend::get_sink()finds an existing sink whose name is not
a valid file path, such as"tcp://collector:4317", instead of aborting. std::optional<T const>, astd::variantwith const alternatives, astd::variantpassed by
const&with an alternative whose copy constructor is deleted and that its codec decodes back
into its own type, and on Windows astd::tupleorstd::variantholding a wide string can be
logged; they failed to compile.- A
std::map,std::multimap,std::setorstd::multisetof strings withstd::greater<Key>,
and astd::unordered_maporstd::unordered_setkeyed bystd::error_codewith
quill/std/SystemError.h, can be logged; they failed to compile. decode_members()can assignstd::variantmembers whose alternatives are not strings, and a
std::variantmember with an alternative that has no formatter compiles withencode_members()
anddecode_members()when the type that holds it has a formatter of its own.- A type with a
std::initializer_listconstructor, such asnlohmann::json, logged through
DeferredFormatCodecor inside astd::arrayis no longer wrapped in a one-element list on GCC. FileSinkwithminimum_fsync_intervalperforms a skipped fsync once the interval elapses and on
the final flush, so the last records are synced, also on a system up for less than the interval.
RotatingFileSinkno longer fsyncs during rotation when fsync is disabled.- A missing log directory no longer stalls the backend for 400 ms on every flush while
FileSink
retries opening the file. FileSinkConfig::set_filename_append_option()and
RotatingFileSinkConfig::set_rotation_time_daily()leave the configuration unchanged when they
throw, and aConsoleSinkwhoseConsoleSinkConfig::set_stream()name is notstdoutor
stderrthrows before it creates the directories of a name such aslogs/console.RotatingFileSinkkeeps rotating after a backup file is deleted or compressed outside Quill,
instead of letting the active file grow without limit.RotatingFileSinkignores a file named with index zero or a zero-padded index, e.g.app.0.log
orapp.01.lognext toapp.log, which stopped rotation in append mode and was deleted by
remove_old_files. In append mode it no longer takes a directory named like one of its backups,
e.g.app.1.log, for a backup, which the next rotation renamed.- With
RotationNamingScheme::DateorDateAndTimeand a file name without an extension, such as
requests, aRotatingFileSinkno longer takesrequests.20240102.1for its backup
requests.1.20240102. Startup with open mode'w'andremove_old_filesenabled deleted such
a file, and in append mode it counted towardsmax_backup_files, so the sink could delete its
own backup. - With
RotationNamingScheme::DateorDateAndTime,RotatingFileSinknames the first backup of
a file that was opened empty after its first record, like every later backup, instead of after
the sink's creation. WithDateAndTime, a restart within the same second no longer overwrites
the previous run's backup. - A
RotatingFileSinkretries a rotation that failed, e.g. on a transient rename error or a failing
fsync, after one second, instead of for every record or, for a time-based rotation, at the next
scheduled rotation. RotatingFileSinkcounts whatFileEventNotifier::after_openwrites to a new file towards
rotation_max_file_size, so a file after a rotation no longer exceeds the limit by those bytes.- A
RotatingFileSinkwithTimezone::LocalTimethrowsQuillError, as it does with
Timezone::GmtTime, when the time of its next rotation cannot be represented, e.g. past 2038
with a 32-bittime_t, instead of using the -1 thatmktime()returns. - In 32-bit builds, a
RotatingFileSinkreads the size of a file of 4 GiB or more correctly. Such a
file could read as empty, soset_rotation_on_creation(true)skipped its backup and open mode
'w'then truncated it. PrometheusSink::register_summary()andregister_summary_family()throwQuillErrorfor
age_buckets <= 0or amax_agethat is not positive or too long for a
std::chrono::steady_clock::duration, andlinear_buckets()andexponential_buckets()throw it
for NaN or infinite arguments.register_histogram()andregister_histogram_family()reject
unsorted bucket boundaries before creating any state, so registering again with corrected
buckets works.- Fixed MSVC named module builds with
QUILL_IMPORT_STD=ONfailing with standard library
redefinition errors or internal compiler errors
(#1012). - On FreeBSD, DragonFlyBSD and OpenBSD, the Quill headers include
pthread.hthemselves instead of
relying on another header to, which fixes a DragonFlyBSD build error with
QUILL_USE_SEQUENTIAL_THREAD_ID. - With
QUILL_USE_SEQUENTIAL_THREAD_ID, a program that imports the C++20 module links without
QUILL_DEFINE_SEQUENTIAL_THREAD_ID. On Linux, an executable and a startup-linked shared library
that both link the static module can share the counter even with hidden visibility. - CMake consumers using MSVCRT-based MinGW no longer link against UCRT through
quill::quill,
avoiding crashes when memory is allocated and freed across incompatible C runtimes.