check_logfile: imporve file scanning and keep track of lines matched in each file#390
check_logfile: imporve file scanning and keep track of lines matched in each file#390inqrphl wants to merge 3 commits into
Conversation
…in each file apply conditional filters to the lines early on while adding them, this was not the case before. now the count of lines being passing the filter is correct. add function to generate a detail string from files and the count of matched lines in the file. this can be added to the detailed syntax when needed. if there are no lines matched across all files, change the main output line to say "No matching lines found in files"
112f913 to
ad5c627
Compare
differentiate between empty states 1) where no files are found, due to given file paths 2) where files are found but do not contain matched lines. write different outputs for both of them, and add tests
ad5c627 to
e1d777c
Compare
|
Should still be UNKNOWN when the file does not exist at all. |
…s exist without matched lines checkdata.finalizeOutput() requires explicit filters or implicit argument filters to apply emptySyntax on output. apply empty syntax on empty state, by setting the "file" and files" argument is set as a filter.
| } | ||
|
|
||
| if !check.MatchMapCondition(check.filter, entry, false) { | ||
| log.Tracef("file: %s , line : %s, did not match the filter set in the check, not ading to check.listData", fileName, line) |
|
-> In my opinion if
-> Trailing
-> Only shows the amount of matching lines per file if nothing matches? I'm not sure how we should handle searching in multiple files, I think like this it's not really clear what it does |
apply conditional filters to the lines early on while adding them, this was not the case before. now the count of lines being passing the filter is correct.
add function to generate a detail string from files and the count of matched lines in the file. this can be added to the detail-syntax when needed. this is saved in check.detail as "file_counts"
Files exist, but do not have matching lines:
No file found: