1 suggestion
Earlier concerns neither republished nor resolved: 2 suggestions. See the Run archive for their assessments.
Optional improvements
[suggestion] · Close-error diagnostics depend on argument evaluation order
Saving errno immediately after fclose fails would make the stderr diagnostic independent of path conversion, although no actual misreport has been demonstrated.
Location: src/logging.cpp:38 (head).
Details and suggested fix
After fclose(file) fails, C++ permits fs::PathToString(path) to run before SysErrorString(errno) captures the error value. The path conversion returns a string and may allocate, with no guarantee here that it preserves errno. Save const int err{errno}; before constructing the message and pass err to SysErrorString. That function takes the value by copy, so subsequent formatting, fwrite and fflush are not part of this concern. No platform where the path conversion actually overwrites errno has been identified, so this is a robustness suggestion confined to the diagnostic text.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: Avoid reporting to stderr under the logger mutex
- [suggestion]: Clarify whether the goal includes active-log write failures