schwehr / libais

C++ decoder for Automatic Identification System for tracking ships and decoding maritime information
Other
215 stars 94 forks source link

Exception tag_block parsing bad message if no line_number passed in #216

Open andyvan-trabus opened 2 years ago

andyvan-trabus commented 2 years ago

TagQueue.put(self, line, line_num=None) has a problem if the line fails to parse, and line_num has the default value of None:

File "/home/avanpelt/git/libais/ais/tag_block.py", line 139, in put logger.info('No NMEA match for line: %d, %s', line_num, line) Message: 'No NMEA match for line: %d, %s'

One fix would be to use self.line_num in the logger.info call.