hello, Steven,
Hope my message reach you out.
I used your sample code and replaced the string I want to extract from
console log, it would not do anything.
I chnage it as text format:
<% def rdr= new InputStreamReader(build.getLogInputStream()) %>
<% rdr.eachLine{ it -> %>
<% if(it.contains("[SVN]")) { %>
<% def line= hudson.console.ConsoleNote.removeNotes(it) %>
${line}
<% }
} %>
I will really appreciate it if you can point out what's wrong. (it seems
yours was HTML, I change it to text format)
Thanks
Victoria
On Wednesday, December 18, 2013 at 8:16:20 AM UTC-6, Steven Deal wrote:
>
> Backstory: our build produces a 35000+ line log file (forget turning down
> the logging level). A compile error or such might be scattered anywhere
> over this output and typically will not be in the last few lines. Build
> emails became nearly useless as they rarely showed a developer what
> actually failed the build. To fix this, I started making more use of a
> custom groovy template and the email-ext plugin to parse out just the
> errors from the build log. Something like:
>
> <% def rdr= new InputStreamReader(build.getLogInputStream()) %>
>
> <% rdr.eachLine{ it -> %>
>
> <% if(it.contains("[error]")) { %>
>
> <% def line= hudson.console.ConsoleNote.removeNotes(it) %>
>
> <TR><TD class="console">${line}</TD></TR>
>
> <% } %>
>
> This worked great from my standpoint. However, many of my developers check
> their email through gmail, which clips the message at a certain size.
> Investigating this, I noticed that the raw source of the email contained
> hundreds of blank lines. Basically, it looks like every line of groovy code
> produces an empty line in the email. So looping through this whole log file
> produces an insane number of blank lines. I suspect this extra content is
> what's causing gmail to clip the message. Given I don't want developers to
> have to click through the email to see the compile error, is there an
> alternative to avoid this within email-ext/groovy?
> -steven
>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/a71c3ced-9cbe-4986-961b-1211ab7c2c30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.