From cfe959036a7e28e9f273d82a3cfed3a69b6e56b8 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Wed, 9 Aug 2023 16:51:14 +1000 Subject: [PATCH] Enable LOG4CXX_MULTI_PROCESS when LOG4CXX_MULTIPROCESS_ROLLING_FILE_APPENDER is enabled --- src/main/cpp/CMakeLists.txt | 1 + src/main/cpp/outputstreamwriter.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/cpp/CMakeLists.txt b/src/main/cpp/CMakeLists.txt index 9a6b6e846..e4aa0ce17 100644 --- a/src/main/cpp/CMakeLists.txt +++ b/src/main/cpp/CMakeLists.txt @@ -48,6 +48,7 @@ if(LOG4CXX_NETWORKING_SUPPORT) endif() if(LOG4CXX_MULTIPROCESS_ROLLING_FILE_APPENDER) + target_compile_definitions(log4cxx PRIVATE LOG4CXX_MULTI_PROCESS) list(APPEND extra_classes multiprocessrollingfileappender.cpp ) diff --git a/src/main/cpp/outputstreamwriter.cpp b/src/main/cpp/outputstreamwriter.cpp index 1ebd320ee..7c8547f04 100644 --- a/src/main/cpp/outputstreamwriter.cpp +++ b/src/main/cpp/outputstreamwriter.cpp @@ -96,7 +96,7 @@ void OutputStreamWriter::write(const LogString& str, Pool& p) // Ensure the logging event is a single write system call to keep events from each process separate if (bufSize < str.length() * 2) { - heapData.resize(bufSize = str.length() * 2) + heapData.resize(bufSize = str.length() * 2); rawbuf = heapData.data(); } #endif