poco
poco copied to clipboard
Consolidate LogFile implementation to use FileOutputStream
LogFile
has different implementations for Windows using Win32 API and STD for other platforms where Poco::FileOutputStream
is used. Poco::FileOutputStream
has Windows and Posix implementations.
LogFile
calls FlushFileBuffers
on Windows which forcefully flushes buffers to disk. Posix equivalent would be fsync
.
- New function
fsync
(orflushToDisk
) shall be added toFileStream_POSIX
andFileStream_WIN32
. - Implementation of
LogFile
shall be unified to useFileOutputStream
Related: #2443, #4429.
Logically, there should be only LogFile, because we have POSIX and WIN32 FileStream; performance may be the reason for the current state.
Some benchmarking would help to make the right decision, ie. whether it makes sense to introduce LogFile_POSIX
, instead of having just one LogFile
.
As for flush/sync, those should be two separate properties and they should have strategies with reasonable defaults.