No longer creating the log file and its folder when file logging is turned off.
Added additional option to auto-flush the log file on every write.
Changed the output to a persistent StreamWriter instead of opening and closing the file every single write.
Now closing journal and netlog readers properly when the auto splitter is shut down by LiveSplit.
Caveats:
There is no way to access the setting from startup. Hence it’s disabled there no matter the actual setting. Currently that only affects the vars.log("Autosplitter loaded"); line.
Since there is no way to be notified of a settings change, they will only take effect a) on loading the game or b) when starting a new run. The latter might introduce a minimal delay in starting the time for the first run after loading the game, then changing the setting. Feel free to test =p
If file logging is enabled without auto flushing, the file is only updated when the write buffer is full. I added explicit Flush()ing to shutdown and reset. On the plus side that means I/O delay for logging is generally not happening while splitting, reducing inaccuracy there.
That means you should probably only enable auto flushing for testing purposes, and I added a tooltip to the setting to reflect that.
StreamWriter
instead of opening and closing the file every single write.Caveats:
startup
. Hence it’s disabled there no matter the actual setting. Currently that only affects thevars.log("Autosplitter loaded");
line.Flush()
ing toshutdown
andreset
. On the plus side that means I/O delay for logging is generally not happening while splitting, reducing inaccuracy there.