rticommunity / rticonnextdds-logparser

RTI Log Parser for Connext DDS is a command-line tool that processes and enhances Connext DDS log messages making it easier to debug applications.
https://www.rti.com/developers/rti-labs/easy-debugging-with-log-parser
Apache License 2.0
13 stars 6 forks source link

Parser stops reading input after an empty line #16

Closed pleonex closed 7 years ago

pleonex commented 7 years ago

If the parser reads an empty line from the input, it stops reading any further input. This is affecting the file and the console input devices.

The reason is that due to a limitation in Python, it's not easy to detect the end of file. The python method readline() returns an empty string when reading an empty line and when the EOF is reached.

The readline() method is returning the new line characters for empty lines. We can use it to distinguish between empty lines and EOF.

An alternative is to change the logic in the input devices to iterate over the stream object returning with yield. A hack for the file input device is to check the file size.