You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only reuse the old counter if the file name pattern has a counter placeholder.
If text_file_backend is set up to append to a previously written file, and
the actively written file name pattern does not include a file counter
placeholder but the target file name pattern does, we used to skip incrementing
the file counter in an attempt to generate the same file name as was last used,
so that we open the last used file for appending. While it did result in
reusing the last written file, since the counter was not incremented, the next
rotation would generate the last used target file name, which would result in
overwriting the last rotated file instead of adding a new file to the storage.
To mitigate this, only skip incrementing the counter if the file name pattern
for the actively written file actually has a counter placeholder. This way,
the counter will get incremented in the case described above, and on rotation
a new target file name will be generated.
Fixes#245.
Copy file name to clipboardExpand all lines: doc/changelog.qbk
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
[/
2
-
Copyright Andrey Semashev 2007 - 2024.
2
+
Copyright Andrey Semashev 2007 - 2025.
3
3
Distributed under the Boost Software License, Version 1.0.
4
4
(See accompanying file LICENSE_1_0.txt or copy at
5
5
http://www.boost.org/LICENSE_1_0.txt)
@@ -13,6 +13,7 @@
13
13
14
14
* Disabled usage of `std::codecvt<char16_t>` and `std::codecvt<char32_t>` locale facets in C++20 and later modes as they were deprecated in C++20. This means character code conversions to/from `char16_t` and `char32_t` is no longer available in C++20 and later.
15
15
* Fixed building issues when using CMake and MinGW-w64. ([pull_request 241])
16
+
* Fixed incorrect file counter used by `text_file_backend` when the backend was configured to append to an existing file and the actively written file name pattern didn't have a counter placeholder but the target file name pattern did, and the log files were written directly into the target storage. ([github_issue 245])
//! The function parses file name pattern and splits it into path and filename and creates a function object that will generate the actual filename from the pattern
0 commit comments