You can wrap multiple lines in <% %>. The way you wrap each line individually 
works, but every line break between %> and %< gets printed.

Instead, do it like this:

> <%      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>
> <%        } %>

On 18.12.2013, at 15:16, Steven Deal <[email protected]> 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].
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to