cppassist icon indicating copy to clipboard operation
cppassist copied to clipboard

FileLogHandler should open file only once

Open j-o opened this issue 7 years ago • 0 comments

Currently, the FileLogHandler opens the target file, writes the message and closes the file again for each log message, which is an unnecessary overhead.

Instead, the file should be opened once on construction and closed on destruction of the log handler. If it is desired to ensure that log messages are written to disk in case of a system crash, std::ostream::flush should be used. This behavior could be configurable.

j-o avatar Jan 20 '17 08:01 j-o