Logging exception handler and fix for stable_log_filename on windows #2880
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Although our logger has never thrown in normal conditions, it has been reported to when stressing the RPC in a RAM node, especially with a low rotation file size. This adds an exception handler that handles by simply printing to stderr. I could not find a way to test the handler in a unit test.
Also fixes an issue with the
stable_log_filename
config on Windows. Thenode.log
file was being created with read-only permissions, so writing to the file after restarting the node would throw an exception. This will be noted in the documentation. However, this also couldn't be unit tested because the file gets the full permissions by default.The change to
nano::logging::release_file_sink ()
enables the added test.