cppassist
cppassist copied to clipboard
FileLogHandler should open file only once
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.