and return output in correct order instead of in reverse.
Instead of relying on the command being complete after 1 second and then going through the log in reverse to find the beginning, we now place two unique beginning and end markers in the log file.
This allows us to
read the log file in the correct order
get all output of the command in real time, even if it takes a little longer to complete
return immediately if the command completes early, instead of always waiting for a constant time of 2 seconds
prevent head aches for future self
Please note that:
this still won't filter out output which is not generated by the sent command (which is not possible without factorio tagging its output)
the NONCMDPATTERN filter is no longer included as it should be optional (at least in my opinion).
Hint: to filter out any garbage such as empty lines, server debug output and these markers, the following code could be used (in this case in tail_chatlog, as the output generated by send_cmd between the markers is also removed)
and return output in correct order instead of in reverse.
Instead of relying on the command being complete after 1 second and then going through the log in reverse to find the beginning, we now place two unique beginning and end markers in the log file. This allows us to
Please note that:
This also fixes #116