cginternals / cginternals/cppassist

FileLogHandler should open file only once

Open
#28 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
29
Forks
9
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.