Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for more precise time formats #1351

Open
ConorMurphy21 opened this issue Dec 3, 2024 · 1 comment
Open

Support for more precise time formats #1351

ConorMurphy21 opened this issue Dec 3, 2024 · 1 comment
Labels
enhancement Feature Request

Comments

@ConorMurphy21
Copy link

Is your feature request related to a problem? Please describe.
I have a log format with: "timestamp-format": [ "%Y-%m-%d %H:%M:%S.%f" ]. This works in theory but due to maybe the limitation of storing the log_time with only 3 bits of precision e.g. "SS.SSS" instead of the 6 from my logs some functionality is wonky.

:hide-lines-before here, and :hide-lines-after here will sometimes hide lines way before or after the current cursor position
:goto may also act imprecisely if I copied a timestamp from some other time format

The most important issue though is that when collating logs from multiple sources it's possible for logs to be out of order, I found an example of this when scanning my logs:

file1─2024-11-25 12:20:19.418361 0 ⋮, ⋮ "bar"                               │
file2┌2024-11-25 12:20:19.418207 1 ⋮, ⋮ "foo"

Describe the solution you'd like
The ideal solution would be to store datetime objects with a higher precision in database and hopefully that would solve all of these problems.

Describe alternatives you've considered
Another workaround idea / maybe useful anyways would be to allow formats to describe a collate order. I.e. after timestamp, what fields should be ordered next when merging log files. In this case my log has an "uptime field", which is a very precise floating point, which could be used to collate the logs (as a secondary criteria to timestamp). Though this doesn't solve some of the wonkyness with the timestamp based commands.

Thanks for any help with this issue. Overall after finding this tool I've been super happy and impressed with it!

@ConorMurphy21 ConorMurphy21 added the enhancement Feature Request label Dec 3, 2024
@tstack
Copy link
Owner

tstack commented Dec 5, 2024

Thanks for filing this, I failed to re-evaluate the memory layout for the data structure that stores information about log lines in recent years (lnav is quite old at this point). I'll fix things up to get this working better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature Request
Projects
None yet
Development

No branches or pull requests

2 participants