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

Add separate parsing of fatal logs #6

Merged
merged 3 commits into from
Mar 18, 2023

Conversation

avsaase
Copy link
Contributor

@avsaase avsaase commented Mar 16, 2023

This PR adds a separate parsing of fatal error logs so that they can be handled separately. I initially did this by adding a FfmpegEvent::LogFatal but in the last commit I changed this to make it a single FfmpegEvent::Log with a LogLevel field. I don't have a strong opinion in either direction so I'll leave the decision up to you.

I also changed the log parsing logic to check if a log line contains the log level in square braces (instead of starting with it) because I encountered a few logs like this that would otherwise be parsed incorrectly:

[swscaler @ 000001ceadc00b80] [swscaler @ 000001ceadd3b7c0] [warning] deprecated pixel format 
used, make sure you did set range correctly

I didn't add tests because there currently aren't any for the parse_next_event function and I didn't know how you want that set up.

@nathanbabcock
Copy link
Owner

@avsaase I will take a closer look within the next few days, but at first glance this looks awesome. I especially like that it handles the edge case when log level is not the first item on the line.

Thanks for taking the time to contribute 🙏

@nathanbabcock nathanbabcock merged commit 700095c into nathanbabcock:main Mar 18, 2023
@avsaase avsaase deleted the log-fatal branch March 18, 2023 14:57
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

Successfully merging this pull request may close these issues.

2 participants