Added code to the RegexColumnizer to avoid null columns & the resulting NullPointer exceptions#276
Merged
Hirogen merged 8 commits intoLogExperts:Developmentfrom Mar 21, 2023
Conversation
…ty strings when the regex doesn't match the log line. Needed to avoid unexpected nullPointers
Collaborator
|
Also please add respective Unit-Testcases :) |
added 5 commits
March 20, 2023 18:04
Author
|
I made the requested changed. my apologies for the extra commits. I had some trouble getting the build to go green (C# is not the language I usually work in). |
Hirogen
requested changes
Mar 21, 2023
|
|
||
| var parsedLogLine = columnizer.SplitLine(Mock.Of<ILogLineColumnizerCallback>(), notMatchingLogLine); | ||
|
|
||
| // verify that the expected number of columns are created |
Collaborator
There was a problem hiding this comment.
Every Assert should be its own testcase, if those are just different data-sets, add the data to the function header (see the examples in "LogExpert.Tests" project :)
Collaborator
There was a problem hiding this comment.
thanks for contributing 👍
Hirogen
approved these changes
Mar 21, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have added some code to the RegexColumnizer that will add columns with empty string when the line doesn't match the regex.
The reason I made this alteration is to fix the following problem I have been having: If you use this RegexColumnizer to read logs that contain stack traces (lines that don't match the regex) you get null columns for that line. This is visualized ok but will result in many error message pop-ups when searching in these columns making it hard to use this columnizer for these kind of logs.
The added code aims to fix this problem by eliminating the null columns. This doesn't change the visualisation but fixed the search problem.