You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Julien CARSIQUE <jc...@nuxeo.com> on 2008/08/27 12:22:51 UTC

log from a plugin

Hi,

How to instantiate a logger from code which do not access to mojo.getLog() ?

If I use SystemStreamLog logger, my debugging logs are always displayed.
What's the right way to get logger, except passing it from the mojo 
through all classes and methods calls ?

Thanks,

PS : I've read in 
http://maven.apache.org/guides/plugin/guide-java-plugin-development.html 
the "Retrieving the Mojo Logger" chapter but it only tell what mustn't 
be done, not what to do in such a case


Re: log from a plugin

Posted by Jochen Wiedmann <jo...@gmail.com>.
On Wed, Aug 27, 2008 at 12:22 PM, Julien CARSIQUE <jc...@nuxeo.com> wrote:

> What's the right way to get logger, except passing it from the mojo through
> all classes and methods calls ?

Put it in a ThreadLocal.

Jochen


-- 
Look, that's why there's rules, understand? So that you think before
you break 'em.

 -- (Terry Pratchett, Thief of Time)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org