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

a number in a multiline log message is mistaken for a timestamp #19

Open
tstack opened this issue Feb 13, 2024 · 0 comments
Open

a number in a multiline log message is mistaken for a timestamp #19

tstack opened this issue Feb 13, 2024 · 0 comments

Comments

@tstack
Copy link

tstack commented Feb 13, 2024

Problem

A number in a log message can be mistaken for a timestamp, which will mess up log merging behavior.

How to reproduce

Load the following log snippet into tl:

Feb 08 09:50:05 Foo-MacBook-Air loginwindow[588]: IASGetCurrentInstallPhaseList: phases = (
	        {
	        ConclusionDelay = 0;
	        InstallPhase = "IOKit Boot";
	        InstallPhaseActualPercentageKey = "21.77734375";
	        InstallPhasePercentageKey = 22;
	    },
	        {
	        ConclusionDelay = 0;
	        InstallPhase = "Boot-Time Installation";
	        InstallPhaseActualPercentageKey = "69.01998901367188";
	        InstallPhasePercentageKey = 69;
	    }
	)

Select the line with "69.01998901367188" and note that the time in the bottom right is something like "04/07/8304 22:58:38". This causes problems when merging log files because these lines show up at the bottom of the merged logs.

Details

Since the TimestampScanner is looking for timestamps anywhere in a log line, a format like the following one is going to mistakenly pick up logged data and treat it as a timestamp:

https://github.com/Textualize/toolong/blob/9fe54a6bcd6bcc2b1066c762057b0de812dcd155/src/toolong/timestamps.py#L92-L93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant