* Add NativeThreadInfo
+ use in Message
+ test with PatternFormatter
* Fix NativeThreadInfo for glibc without gettid
* add new file to make
* chore: formatting
* fix(NativeThreadinfo): name and id #3333
* fix(NativeThread): add OS includes #3333
* fix(Message): use OS thread ID for non-POCO threads #3333
Fix Message initialization to correctly handle thread IDs for both POCO
and non-POCO threads. When Thread::current() returns null (std::thread,
main thread, etc.), use NativeThreadInfo to get the OS thread ID instead
of leaving _tid as zero.
Rename NativeThreadInfo::id() to NativeThreadInfo::osTid() to match the
Thread::currentOsTid() naming convention and clarify that both return
the same kernel-level thread identifier (not the POCO sequential ID).
Additional changes:
- Add comprehensive documentation to NativeThreadInfo explaining its
purpose and when to use it vs Thread::current()
- Fix LoggerTest warning by removing pessimizing std::move in return
- Update all platform implementations (POSIX, WIN32, WINCE, VxWorks)
This ensures the %I format specifier in PatternFormatter shows:
- POCO thread ID (1, 2, 3...) for Poco::Thread instances
- OS thread ID for non-POCO threads (std::thread, main thread, etc.)
* fix(LoggerTest): compare thread ID against actual value #3333
testFormatThreadName was failing in CI because it expected the POCO
thread ID to be 1, but in a full test run, many threads are created
before this test (by ThreadingTestSuite, etc.), resulting in higher IDs.
The test now compares against the actual thread's ID (thr.id()) instead
of a hard-coded value, making it robust regardless of test order.
* fix(NativeThreadInfo): windows compile #3333
* fix(NativeThreadInfo): mac compile fail; consolidate platform pthread functions selection #3333
* fix(NativeThreadInfo): use UTF8 #3333
* fix: remove NativeThreadInfo (not needed) #3333
* fix(Thread): proper UTF-8 handling and test robustness #3333
- Thread_WIN32: Use MultiByteToWideChar with CP_UTF8 in setCurrentNameImpl
instead of byte-by-byte iterator copy. The old conversion was incorrect
for non-ASCII characters (e.g., Japanese thread names).
- LoggerTest: Add bounds check (parts.size() >= 5) before accessing vector
elements to prevent undefined behavior if log message format is unexpected.
* fix(Message): disable thread name on platforms that don't have it #3333
* fix(Thread): make getCurrentName/setCurrentName always available #3333
Move POCO_NO_THREADNAME guard inside inline implementations instead of
around declarations. This ensures the API is always available on all
platforms, returning empty string or no-op on platforms without thread
name support (e.g., emscripten, AIX).
Update Message.cpp to remove conditional compilation since the functions
are now unconditionally available.
* fix(Thread): Windows backward compatibility and code cleanup #3333
Thread_WIN32.cpp:
- Use dynamic loading for SetThreadDescription/GetThreadDescription
via GetProcAddress for compatibility with pre-Windows 10 1607
- setCurrentNameImpl tries modern API first, falls back to legacy
exception method (0x406D1388) for older Windows/debuggers
- Remove redundant processthreadsapi.h and stringapiset.h includes
(already included via windows.h)
LoggerTest.cpp:
- Simplify loop condition (remove redundant npos check)
- Fix code style (braces on new lines)
---------
Co-authored-by: Olivier Smeesters <osm@idirect.net>
* fix(SharedLibrary): Missing DLLs not reported #5069
* fix(CMake): not producing proper binary names #5070
* fix(SharedLibrary): disable shared lib tests in static build #5069
* fix(misc): add pdjson links to gitignore, remove unused var in SharedLibrary, harden TaskManagerTest
* fic(ci): separate oracle and sqlserver odbc (out of disk space) (#5075)
* fic(ci): separate oracle and sqlserver odbc (out of disk space)
* use oracle odbc driver
* use oracle free
* ad db user
* postpone adding user after build
* remove default tablespace (does not exist)
* reinstate all ci jobs
* add postgresl odb tests to ci
* remove spurious syminks
* fix gitignore (pdjson)
* Remove VS projects #5076
* chore: revert leftover ODB IP address
* fix(CodeQL): float comparison alerts
* fix: compile errors
* chore: upgrade asan to macos-14 (tryout)
* fix: .gitignore symlinks; XML Makefile wrong pattern
* Optimize PatternFormatter and Timezone performance #5078
PatternFormatter:
- Cache node name (Environment::nodeName()) to avoid repeated syscalls
- Add extractBasename() for efficient %O format specifier
- Add string reserve(128) to reduce reallocations during formatting
Timezone:
- Cache UTC offset to avoid repeated syscalls (8x speedup for %L patterns)
- Auto-detect TZ environment variable changes to invalidate cache
- Add reloadCache() method for explicit cache refresh
Tests:
- Add TimezoneTest::testUtcOffsetCaching()
- Add PatternFormatterTest::testExtractBasename()
* fix: use Path::separatorin extractBasename #5078
* Add Benchmark #5080
* enh(Logging): move constructors for Message and Logger #5078
* chore(AsyncNotificationCenter): eliminate MSVC warnings
* enh(build): c++20 support #5084
* feat(CppUnit): print class name
execute all named tests (not only the first one)
accept test name with class (eg. testrunner LoggerTest::testLogger) #5083
* feat(Benchmark): Add Logger/FastLogger comparison benchmarks and Windows support
- Add LoggerBench.cpp with AsyncChannel vs FastLogger benchmarks
- Add compare.sh (Linux/macOS) and compare.ps1 (Windows) scripts
- Add LOGGER_BENCHMARK.md with cross-platform benchmark results
- Update README.md with Windows build instructions (Ninja, CMAKE_PREFIX_PATH)
- Add error message when -- options are used on Windows (should use /)
- Update CMakeLists.txt and Makefile to include LoggerBench #5080
* feat(FastLogger): #5078
FastLogger provides a Poco-compatible wrapper around the Quill logging
library, offering significant performance improvements over AsyncChannel
through lock-free SPSC queues and backend thread processing.
Key features:
- Drop-in replacement for Poco::Logger with FastLogger::get()
- Support for all standard Poco channels (Console, File, Rotating, etc.)
- XML/properties configuration via FastLoggerConfigurator
- Thread affinity for backend worker on Linux and Windows
- Log file rotation with size and time-based policies
Performance (CPU time - calling thread latency):
- Linux: 31-70x faster than AsyncChannel
- Windows: 23-87x faster than AsyncChannel
- macOS: Limited improvement due to lack of thread affinity support
New files:
- Foundation/include/Poco/FastLogger.h
- Foundation/src/FastLogger.cpp
- Util/include/Poco/Util/FastLoggerConfigurator.h
- Util/src/FastLoggerConfigurator.cpp
- dependencies/quill/ (header-only Quill 7.5.0 library)
* fix(cmake): disable FastLogger on emscripten (not supported) #5078
* feat(FastLogger): add cpuAfinity config parameter #5087
* fix(FastLogger): Fix lock-order-inversion in FastLogger (TSAN) #5078
* fix(cmake): build not stripping release binaries #5085
* fix(PCRE): fails to compile with clang/c++20 #5131
* feat(AsyncChannel): add CPU affinity property #5087
* feat(SpinlockMutex): make it adaptive #5132
* feat(AsyncChannel): add CPU affinity property #5087
* chore: remove leftover file commited by mistake
* feat(build): allow FastLogger to be fully disabled at build time #5078
Build system changes:
- Add POCO_NO_FASTLOGGER compile definition in CMake when ENABLE_FASTLOGGER=OFF
to prevent Config.h from auto-enabling FastLogger
- Add ifdef guards around FastLogger tests in LoggingTestSuite.cpp
- Exclude FastLoggerTest.cpp and FastLoggerChannelsTest.cpp from CMake build
when FastLogger is disabled
- Add POCO_NO_FASTLOGGER support to Make build system for Foundation and Util
- Add CI jobs to verify builds work without FastLogger (CMake and Make)
Code changes:
- Add LoggingConfigurator::configure() convenience method for quick logging setup
* fix(ci): testrunner args
* chore(progen): remove leftover script #5076
* fix(test): give ANC a bit more time to process
* fix(ci): set env before test run
* chore(doc): quill license
* feat(Channel): add log(Message&&) #5133
* fix(ci): set env before test run
* fix(TestRunner): don't search children #5083
* feat: lock-free queues #5134
* feat(Benchmark): various comparisons
* chore: cleanup benchmark
* enh(Logger): simplified logging macros.
* enh(Delegate): Simplify code with constexpr and std::conditional_t.
* enh(NumericString): Simplify code with constexpr and std::is_signed_v.
* enh(MetaProgramming): Simplify code with C++17 equivalents.
* enh(Tuple): Simplify code with C++17 equivalents.
* enh(TypeList): Remove metaprogramming features that are not used.
* enh(Modules): Remove obsolete Foundation functionality
* enh(Foundation): Compile and run deprecated functionality only when POCO_TEST_DEPRECATED is enabled. Update comments for deprecated functionality.
* fix(Modules): Add missing conditional forward declarations for Foundation.
* fix(SharedLibrary): Missing DLLs not reported #5069
* fix(CMake): not producing proper binary names #5070
* fix(SharedLibrary): disable shared lib tests in static build #5069
* fix(misc): add pdjson links to gitignore, remove unused var in SharedLibrary, harden TaskManagerTest
* fic(ci): separate oracle and sqlserver odbc (out of disk space) (#5075)
* fic(ci): separate oracle and sqlserver odbc (out of disk space)
* use oracle odbc driver
* use oracle free
* ad db user
* postpone adding user after build
* remove default tablespace (does not exist)
* reinstate all ci jobs
* add postgresl odb tests to ci
* remove spurious syminks
* fix gitignore (pdjson)
* Remove VS projects #5076
* chore: revert leftover ODB IP address
* fix(CodeQL): float comparison alerts
* fix: compile errors
* chore: upgrade asan to macos-14 (tryout)
* fix(CI): Github macos-13 runner is deprecated, use macos-15-intel to run tests on Intel macOS
---------
Co-authored-by: Matej Kenda <matejken@gmail.com>
* feat(AsyncNotificationCenter): Auto-configure number of workers #5060
add/removeObserver utility functions
move AsyncNotificationCenter tests into a separate file
tests
* chore: update copyrighht
* chore(PCRE): properly detect library type on newer macOS
* chore(ZLIB): move source files to own zlib directory and update CMake files.
* chore(PCRE): move source files to own pcre2 directory and update CMake files.
* chore(UTF8PROC): move source files to own utf8proc directory and update CMake files.
* chore(ZLIB): remove header files
* chore(PDJSON): move source files to own pdjson directory and update CMake files.
* chore(SQLite3): move source files to own sqlite3 directory and update CMake files.
* chore(UNBUNDLED): Correct includes.
* chore(expat): move source files to own expat directory and update CMake files.
* chore(wepoll): move source files to own wepoll directory and update CMake files.
* chore(7zip): move source files to own 7zip directory and update CMake files.
* chore(CMake): fix compile and link flags for dependent static libraries
* chore(CMake): set PCRE2_STATIC when building PCRE2.
* chore(SQLite3): Set SQLITE_THREADSAFE for unbundled build, add warnings.
* chore(CMake): Modifications to build and link properly static target libraries (using OBJECT library type and link using BUILD_LOCAL_INTERFACE)
* chore(CMake): fix order of includes in main CMakeLists.txt.
* chore(CI): Build mysql tests with cmake.
* chore(CI): Build mongodb, redis, sqlite no parser tests with cmake.
* chore(CI): Build odbc tests with cmake.
* chore(CI): Build more ations with cmake, other fixes.
* chore(CI): Fixes for macOS
* chore(CMake): extract hpdf and png files to own directories in dependencies
* fix(CMake): include dependencies after all module dependencies are resolved.
* fix(CMake): Improve dependency handling of dependencies to compile them only when necessary.
* fix(CMake): PDF: move t4.h to proper directory, modify include.
* fix(CMake): Fixes to link properly on all platforms.
* fix(CMAKE): Wrong ENABLE for SQLITE
* enh(PDF): Remove dependencies on hpdf headers from Poco::PDF interface and make usage of hpdf only internal.
* enh(CI): Convert more jobs to use cmake.
* enh(CI): Convert macOS sanitizer jobs to use cmake.
* enh(mkrelease): Copy dependencies when creating release package.
* eng(CMake): Add missing POCO_SO option to enable/disable small object optimization.
* enh(CI): Run linux sanitizer with cmake, various fixes and improvements.
* fix(CMake): bundled build: ZLIB::ZLIB is already linked with Foundation, no need to link again to Poco::Zip
* fix(CI): vptr undefined sanitizer causes foundation tests to fail when linking, disable it
* chore(tests): Minor code improvements.
* fix(AsyncNotificationCenter): fix a data race with member _listsEmpty by making it atomic.
* eng(CI): Add a few more time sensitive tests to cppignore.lnx
* chore(Thread): Code updates.
* eng(CI): Add a few more time sensitive tests to cppignore.lnx
* fix(AsyncNotificationCenter): must join threads to avoid data race in dtor.
* chore(CI): Pass TSAN_OPTIONS to jobs where necessary
* chore(CI): run rests without sudo, compile with parallelism
* chore(CI): Use POCO_MINIMAL_BUILD to simplify CMake configure lines.
* chore(CI): Add 32-bit Windows VS build
* chore(CMake): Printout cmake generator platform.
* chore(CMake): linux-gcc-make-armv7l -> linux-gcc-cmake-armv7l
* chore(ci): windows-2025-msvc-cmake-32bit -> windows-2025-msvc-cmake-Win32
* chore(CI): Convert all remaining jobs to CMake.
* chore(make): Prevent building with make.
* chore(CodeQL): exclude all external code from CodeQL checks.
* chore(macOS): Set min support version to 13.3 to properly support C++20 standard.
* enh(cmake): Add option POCO_CXX20 to enable standard C++20 and related changes.
* chore(cmake): do not allow C++20 setting for compilers that do not support it properly.
* fix(NetSSL_Win): indentation.
* Take the absolute value of the value in numValDigits to fix the precision loss check for negative values.
* fix(VarHolder): Correct numValDigits to properly convert to signed integer.
* Potential fix for code scanning alert no. 1075: Declaration hides variable
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
---------
Co-authored-by: Mias <mias@innoventix.co.za>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* fix(CMake): Select MSVC runtime library with variable CMAKE_MSVC_RUNTIME_LIBRARY instead of modifying compiler flags.
* enh(CI): Add static and MT MSVC builds.
* fix(CMake): Correct TestLibrary DLL name when building with MSVC
Activity _running flag is now set to false when the activity finishes or throws, previously it was only set if wait had been called. Added test for this scenario
* fix(NamedEvent): Release semaphore ID in dtor when created with semget (#2971)
* Temporary: trying to solve for non-Linux semaphores.
* chore(NamedEvent): Cleanup of Posix NamedEvent and fixes of unit test.
* add RWLock implementation for file [posix]
* add implementation FileStreamRWLock for windows
replace FileStreamRWLock to the Process package
* add files FileStreamRWLock* into makefile and vcproj
* remove unnecessary file from makefile
* use absolute path to the TesApp with ProcessRunner
* fix vc*.proj
* add new test files into vc.proj.filters
* fix comments
* fix spelling fo PR #4723
add atomic_bool _locked and check if FileStreamRWLock is locked on
destruction for force unlock
* add atomic header
* File lock (#4740)
* throw error on any errno not only on EDEADLK
* fix function naming
* fix windows build
* fix windows build
---------
Co-authored-by: Alexander B <ale.bychuk@gmail.com>
Co-authored-by: bas524 <bas524@ya.ru>
* chore(Trace): add dev env settings
* add(Trace): init add Poco::trace and libbacktrace files
* feat(Exception): generate stack trace if enabled at compile time
* chore(DNSSD): remove binaries from git
* fix(Trace): build
* chore(ci): exclude exception text tests for trace build; add debug test script params
* chore(build): mac (dl)
* chore(cmake): Changes to build Trace with CMake.
* chore(cmake): Changes to build Trace on Windows
* chore(cmake): Improvements to include trace sample.
* chore(cmake): Fixes to properly build/link Trace on Linux
* chore(cmake): add_definitions --> add_compile_definitions
* chore(cmake): Build Trace as static and don't export it.
* chore(make): Link Trace with built-in libbacktrace on Linux
* chore(Trace): remove unnecessary sources for libbacktrace.
* chore(github): enable trace on a few github checks
* chore(cmake): Build Trace with clang++ on Linux.
* chore(cmake): Properly set POCO_ENABLE_TRACE globally when needed.
* fix(cmake): Trace: corrected include for clang on Linux
---------
Co-authored-by: Matej Kenda <matejken@gmail.com>
* foundation: Remove unused ucp.h
Nothing use this and it is not even included in Visual Studio project
files. Remove it so it will not confuse any more.
* foundation: Hide zlib from user
Hide zlib completly from user. This way we do not need to publish zlib.h
or zconfig.h.
As we now have two different pointer initalizing in constructor I choose
to use unique pointers so it is more obvious those are safe. I also
choose to use make_unique which default initalize z_stream_t. This makes
code more readable as we do not need to specifie every field of
z_stream_t. It really should not matter much if we initialize couple
field for nothing. If does we should add comment about that. Still
keeping _buffer without inializing as it is quite big.
* xml: Hide expat and ParserEngine from user
Hide expat completly from user. This way we do not need to publish
expat.h or expat_external.h.
I move also headers to orignal locations so diff is smaller compared to
original.
* chore(Foundation): Compression level constants
---------
Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
* Poco::DateTime uses assertions for validation #1540
* fix(DateTime): fix ASAN buf overflow
* fix(DateTime): allow negative year (TODO: 0 Julian day Gregorian year value)