Hello Dennis,

Yup - the odd/strange error printout in the Cobertura Maven Plugin comes
from the underlying Cobertura framework printing some logging statements to
the standard error stream.
This is something which simply should be changed/fixed in Cobertura.

2014-11-11 13:35 GMT+01:00 Dennis Lundberg <denn...@apache.org>:

> Thanks Kristian,
>
> Yes, the output is going to stderr. I've confirmed that via some
> debugging statements in the plugin.
>
> I haven't used native JUL before, but I'll investigate it. Any
> pointers are much appreciated.
>
>
> Here is a snippet of the code that does the logging in Cobertura:
>
> import java.util.logging.Level;
> import java.util.logging.Logger;
>
> private static Logger logger =
> Logger.getLogger(CoverageDataFileHandler.class.getCanonicalName());
> logger.log(Level.INFO, "Cobertura: Loaded information on " +
> projectData.getNumberOfClasses() + " classes.");
>
> On Tue, Nov 11, 2014 at 9:19 AM, Kristian Rosenvold
> <kristian.rosenv...@gmail.com> wrote:
> > It would appear to me that this output is coming to stderr, which is
> > why it's being logged to ERROR. Any way to make JUL not go to stderr ?
> >
> > Kristian
> >
> >
> > 2014-11-11 8:48 GMT+01:00 Dennis Lundberg <denn...@apache.org>:
> >> Hi,
> >>
> >> I'm working on the Cobertura Maven Plugin over at Mojo, and have run
> >> into a problem that I cannot solve.
> >>
> >> This plugin wraps an external tool, Cobertura, which logs stuff either
> >> by System.out.println() or by using Java Util Logging (JUL). The
> >> printing to standard out/err is not a problem and the output ends up
> >> where expected. The problem is with JUL. Here's an output example when
> >> using Cobertura's own command line inteface:
> >>
> >> Cobertura 2.0.3 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
> >> 2014-nov-11 08:18:03
> >> net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler
> >> loadCoverageData
> >> INFO: Cobertura: Loaded information on 5 classes.
> >> Report time: 231ms
> >>
> >> The first line is using stdout and the last 2 lines are a log message
> using JUL.
> >>
> >> Now here's what the output form the plugin looks like, after being
> >> handled by CommandLineUtils.executeCommanLine() from plexus-utils:
> >>
> >> [INFO] Cobertura 2.0.3 - GNU GPL License (NO WARRANTY) - See COPYRIGHT
> file
> >> [ERROR] 2014-nov-11 08:24:29
> >> net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler
> >> loadCoverageData
> >> INFO: Cobertura: Loaded information on 5 classes.
> >>
> >> As you can see the first line is OK, but the second line is not.
> >> Somewhere the logging output from JUL is interpreted as being an error
> >> on the Maven side of things.
> >>
> >> Is there any way to tell plexus-utils to treat JUL as being on INFO
> >> level, or better yet to wrap JUL inside a Mojo logger?
> >>
> >>
> >> --
> >> Dennis Lundberg
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> >> For additional commands, e-mail: dev-h...@maven.apache.org
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> > For additional commands, e-mail: dev-h...@maven.apache.org
> >
>
>
>
> --
> Dennis Lundberg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org
>
>


-- 

--
+==============================+
| Bästa hälsningar,
| [sw. "Best regards"]
|
| Lennart Jörelid
| EAI Architect & Integrator
|
| jGuru Europe AB
| Mölnlycke - Kista
|
| Email: l...@jguru.se
| URL:   www.jguru.se
| Phone
| (skype):    jgurueurope
| (intl):     +46 708 507 603
| (domestic): 0708 - 507 603
+==============================+

Reply via email to