-
Notifications
You must be signed in to change notification settings - Fork 8
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
avoid logging empty lines, so removing complete log lines becomes possible #2
Conversation
@TorstenKruse thanks for this. The 1 makes me unsure a bit. This might behave different on different platforms? Can you check for only white space content? |
@amandel Like this? |
Not quiet, wow all modified lines containing a white space are removed. Since we are on java 8, what about iterating though the characters of the line and see if there is no |
I don't understand your comment. All lines containing at least one non-whitespace char are printed. This does not implicate that all lines with a whitespace are removed. :) We have the patch already running in our jenkins and the logs are fine as expected - which means only the lines which contain only whitespace chars are removed. So please re-check the code and perhaps try it out yourself. ;) |
BTW: Looks like the complete plugin does work for freestyle and maven jobs, but not for pipeline. Or am I missing something? |
I did a test on windows with simple echos using To use the logFileFilter in the pipeline simply surround the code: ...
logFileFilter {
...
echo 'Test secret.'
...
}
... I'll add this to the documentation. |
You are right. Looks like the old line endings story on windows vs. linux. I enhanced the regexp to allow \r and \n. Please try again. Adding info about pipeline usage to the documentation sounds good. But in my view one of the key features of logFileFilter is its global usage. Just activate in jenkins setting, define some regex and it works for all jobs out of the box. Instead of this the need to add a "logFileFilter {}" to all pipelines...for hundred of jobs...that not what I would like to get. ;) |
As I remember this was not possible at the time of writing the plugin two years ago. Actually there is (was?) no default log file filtering at all. Might be this changed, I do not know :( . |
So far it was not possible to completly filter log lines. Even when the regex matched to complete line, the plugin still logged an empty line, so the build log contains many, many empty lines.
With this PR empty lines won't be logged any more, so build logs become cleaner.