fix(FastLogger): enable SplitterChannel #5379#5380
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates FastLogger so it can correctly adapt a SplitterChannel into multiple Quill sinks (instead of falling back to a single console sink), and adds coverage for the new behavior. It also introduces a standalone Windows PowerShell build/test helper script.
Changes:
- Add
SplitterChannel::getChannel()accessor and updateFastLoggersink collection to recursively enumerate splitter children (plus sink de-duplication). - Add/extend Foundation tests to verify splitter fan-out and graceful skipping of unsupported
EventChannelinside a splitter. - Add
build.ps1to configure/build/test Poco on Windows via CMake and Visual Studio toolchain setup.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Foundation/testsuite/src/FastLoggerChannelsTest.h | Declares a new test for EventChannel behavior under FastLogger. |
| Foundation/testsuite/src/FastLoggerChannelsTest.cpp | Expands splitter coverage and adds an EventChannel-skipping test. |
| Foundation/src/SplitterChannel.cpp | Implements getChannel(int) to enable safe child enumeration. |
| Foundation/src/FastLogger.cpp | Recurses into SplitterChannel children, skips EventChannel, and de-duplicates sinks. |
| Foundation/include/Poco/SplitterChannel.h | Exposes getChannel(int) in the public API. |
| build.ps1 | Adds a Windows standalone build/test script for Poco via CMake. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
06da79f to
d1f0ff2
Compare
|
@aleks-f, I reviewed the code and made come corrections. Can you please verify that my changes are sane? Then I'd merge to main. |
the main reason for fast logger was speedup, which was partially because of pattern formatting. if we completely disregard quill pattern formatting, part of the speedup goes away and fast logger loses at least a part its original purpose. To see what we currently have in this PR, we need benchmark results on linux and windows to tell whether fast logger as it is now actually brings any benefit. Also, FastLogger must remain transparent - adding |
|
Benchmark results comparing FastLogger with the regular Logger (Linux, OrbStack 18-core VM, null sinks, same pattern). Numbers are cost per logging call; CPU is time on the logging thread. Cases are in Benchmark/src/LoggerBench.cpp. Single sink, typical pattern: regular Logger 472 ns; FastLogger direct API 8.4 ns CPU (87 ns wall); FastLogger through Poco::Logger (type=fast) 437 ns. SplitterChannel fan-out, cost per call by sink count:
Regular logging cost grows linearly with the sink count, because it formats once per child on the logging thread. FastLogger cost is independent of the sink count: the logging thread enqueues once and the backend renders and fans out. The direct API is 52x faster at one sink and 97x at eight; through Poco::Logger it is 1.6x at one sink and 2.9x at eight. With a single sink the Poco::Logger path is not faster than the regular Logger, because Poco::Logger builds the full Message (timestamp, thread id, source) synchronously before the channel, and that cost is not deferred to Quill. The direct API avoids it. For multiple sinks the Poco::Logger path still gains, since the regular path pays per-sink formatting and FastLogger does not. |
… local time, per-logger levels #5379 Adds SplitterChannel fan-out, per-source bridge logging that preserves the source name, local-time formatting (honoring times/%L), per-logger levels, per-source flush and bounding, atomic level/pointer reads, and setPattern/addFileSink that throw instead of a silent no-op. Co-Authored-By: Matej Kenda <matejken@gmail.com>
Installs the FastLogger as the Poco::Logger channel and mirrors the level only when configured. Co-Authored-By: Matej Kenda <matejken@gmail.com>
…nd SplitterChannel #5379 Co-Authored-By: Matej Kenda <matejken@gmail.com>
…le (#5381) Replaces the global add_executable override with a macro (no parent-scope leak, no CMP0155 capture) and drops the redundant per-target DEBUG_POSTFIX lines. Co-Authored-By: Matej Kenda <matejken@gmail.com>
…arity and historyView attach ownership #5370
b83ca11 to
a6cde72
Compare
Makes the FastLogger
type=fastlogging path production-ready and removes the SplitterChannel limitation. Rebased onmain.Fixes #5379. Also fixes #5381 (Debug
dpostfix for executables).Feature
Poco::Loggersource gets its own Quill logger, preserving%s/%(logger).type=fastusable fromPoco::Loggerby installing the FastLogger as the logger's channel, preserving source names.type=fast.times/%L, keep timestamp separators.Correctness and robustness fixes
setChannel()releases the prior per-source Quill loggers, so a reconfigure rebinds each source to the new sinks instead of reusing stale ones.setPattern()/addFileSink()throwNotImplementedExceptioninstead of a silent no-op (addFileSinkno longer truncates the target file as a side effect); sinks and pattern come from the Channel passed tosetChannel()._leveland the opaque Quill/source-state pointers are atomic for the lock-free reads on the logging path.Poco::Loggerlevel only when one is configured; otherwise leave hierarchy inheritance intact.quill.*backend option with a warning instead of throwing from the first log call.Build (#5381)
dpostfix via apoco_add_executablemacro instead of overriding the built-inadd_executable. The global override leaked into projects that build Poco throughadd_subdirectoryand capturedCMP0155, disabling C++20 module scanning for the executables it created. The now-redundant per-targetDEBUG_POSTFIXlines are removed.build.ps1dev script.Tests
Also includes minor Data/SQLite test and documentation additions (#5370).