mirror of
https://github.com/boostorg/log.git
synced 2026-01-19 04:22:09 +00:00
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 https://github.com/boostorg/log/issues/245.