emilk / loguru

A lightweight C++ logging library
The Unlicense
1.76k stars 256 forks source link

Replace _fsopen on Windows to allow the opened file to be used by logrotate (supporting move and delete operations) #251

Open sunbuny opened 2 months ago

sunbuny commented 2 months ago

When using loguru on Windows with#define LOGURU_WITH_FILEABS 1, logrotate cannot be used to manage the growing file size. This is because files opened with _fsopen cannot be used by logrotate while the process is still running. I made some modifications to solve this issue and conducted some tests.