Open dkorecko opened 1 year ago
I guess you can perform all necessary checks inside your "HandleFileError" handler to choose an alternate file name that is 100% not used. It is definitely more safe than making "HandleFileError" recursive (in some cases this may lead to infinite recursion which is definitely bad design).
Essentially, I would think that if in the HandleFileError I add a string to the file name, then if the initial log file is being used by another process and the alternative file name is also being used by a different process, it would just do something like "FileName_alt_alt.log" instead of just crashing on "FileName_alt".
Thoughts?