You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by sw...@apache.org on 2026/10/18 01:03:18 UTC
(logging-log4cxx) branch make_lazy_file_creation_unsurprising created (now f7879a5f)
This is an automated email from the ASF dual-hosted git repository.
swebb2066 pushed a change to branch make_lazy_file_creation_unsurprising
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
at f7879a5f Make lazy log file creation unsurprising
This branch includes the following new commits:
new f7879a5f Make lazy log file creation unsurprising
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(logging-log4cxx) 01/01: Make lazy log file creation unsurprising
Posted by sw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
swebb2066 pushed a commit to branch make_lazy_file_creation_unsurprising
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
commit f7879a5fe7ab900fe89a9cf7920a9a42c5c441c1
Author: Stephen Webb <sw...@gmail.com>
AuthorDate: Sun Oct 18 12:02:56 2026 +1100
Make lazy log file creation unsurprising
---
src/main/cpp/fileoutputstream.cpp | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/src/main/cpp/fileoutputstream.cpp b/src/main/cpp/fileoutputstream.cpp
index fae252f2..188ca493 100644
--- a/src/main/cpp/fileoutputstream.cpp
+++ b/src/main/cpp/fileoutputstream.cpp
@@ -36,27 +36,16 @@ struct FileOutputStream::FileOutputStreamPrivate
apr_file_t* fileptr{ nullptr };
bool logAppend;
void open();
- void openUnlessLazy(bool lazyOpen);
};
IMPLEMENT_LOG4CXX_OBJECT(FileOutputStream)
FileOutputStream::FileOutputStream(const LogString& filename, bool append, bool lazyOpen)
: m_priv(std::make_unique<FileOutputStreamPrivate>(filename, append))
-{
- m_priv->openUnlessLazy(lazyOpen);
-}
-
-void FileOutputStream::FileOutputStreamPrivate::openUnlessLazy(bool lazyOpen)
{
if (!lazyOpen)
{
- this->open();
- }
- else if (!this->logAppend && this->path.exists())
- {
- // Truncate the file (i.e. remove its contents)
- this->open();
+ m_priv->open();
}
}