fclose() can report write errors (for example if the disk is full or the filesystem has a problem). Right now, some fclose() calls in src/logging.cpp ignore the return value. This means errors might go unnoticed and log lines could be lost without warning.
What this PR does:
- Add a small helper that prints fclose()errors tostderr(with path and errno).
- In shutdown: close m_fileoutsafely and report errors.
- In reopen: open the new file, swap it in, close the old one, and report errors if closing fails.
- In shrink/rotate: check all fclose(file)calls and report failures.
No other behavior changes. Normal logging, rotation, and console output remain unchanged.