Support for space padded log lines
Some log formats are space padded (like how json_lines might be displayed).
so a line might look like
12:00:00 INFO something happened
These formats are mostly fine in lnav, the problem is you :hide-fields level then the format looks like this:
12:00:00 ⋮ something happened
Which can be especially space wasteful if you hide multiple fields.
I think this could be relatively easily fixed by adding a property like "padded": "left|right" to a format (either global or per value), and then using that to delete the space to the left or right of a value when hiding that field.
I think this is technically possible now if you use a capture that wraps around the level the white-space. You can then hide that. Something like:
(?<level_column>(?<level>INFO|WARN|ERROR)\s+)
Interesting, yeah that's useful to know, I was considering including the space in the field itself but then it wouldn't parse properly. I think there still could be room to improve to improve this use case but that is a decent option. I guess that solution could allow a more generic handling of any formatting that is around a field.
With this solution it would be nice to have :show/hide-fields level hide the level_column as well / instead. And also to keep wrappers hidden in sql vtables so that results don't get bloated with doubled columns.
I've pushed a change that is somewhat related to this, see -- https://github.com/tstack/lnav/issues/375#issuecomment-2692346456