Closed larray closed 1 year ago
Original log example with line reference: Filter Lines output example:
Hey! Thank you for the report. This behavior was inherited from the original Sublime Text plugin (https://packagecontrol.io/packages/Filter%20Lines) and I was hesitant to change it. But now that I think about it, 1-based line numbers indeed make more sense and, like page numbers for example, start with line/page 1 much more often than with line/page 0. I will change it soon and release a new version of the extension.
Thanks for the consideration and quick response!
I wasn’t sure where it came from and assumed something in the handling made an inadvertent adjustment.
Even having a switch in preferences may make sense - there may be times it is needed (especially if the origin code considers it relevant). For me - when doing log comparison though it was an oddity. I tried to discuss the origin log with a team member and began documenting line numbers after filtering and found all my references to be inaccurate. (Document didn’t match the source)
Fantastic tool though!
Just published version 1.1.0. You are welcome :)
Log file - Text being filtered example: 2023-08-08T12:57:07.231Z[00:000000:client-registration] (end of log lines cut off - irrelevant to the issue)
Regex Filter: ((\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d{3})Z)[\d{2}:\d{6}:client-registration]
For the example above in the source log - lines that match that pattern appear on line numbers: 47: 2023-08-08THH:MM:SS.mmmZ[00:000000:client-registration] 87: 2023-08-08THH:MM:SS.mmmZ[00:000000:client-registration] 103: 2023-08-08THH:MM:SS.mmmZ[00:000000:client-registration]
When processed through "Filter Lines: Include Lines with Regex and Context" they are presented as being 1 log line reference LOWER. Filtered log output would look like: 46: 2023-08-08THH:MM:SS.mmmZ[00:000000:client-registration] 86: 2023-08-08THH:MM:SS.mmmZ[00:000000:client-registration] 102: 2023-08-08THH:MM:SS.mmmZ[00:000000:client-registration]