You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Mark Hobson <ma...@gmail.com> on 2007/07/13 15:13:58 UTC

Logging in components

Hi,

I want to add some debug logging to the dependency tree shared
component which is used in the dependency:tree goal.  Is the preferred
way for the component to extend LogEnabled, and if so, is there any
way of getting the log set automatically by plexus?  The alternative
would be for the mojo to explicit set the log itself, but then I'd
have to adapt the mojo Log to a plexus Logger.

Cheers,

Mark

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


Re: Logging in components

Posted by John Casey <jd...@commonjava.org>.
yeah, that'd probably do it. It seems like I had a similar problem  
once in the assembly plugin, and wound up excluding the component-api  
dependency from the plexus-container-default artifact. It may need to  
be declared as provided...not sure. Anyhow, I was having trouble with  
the Contextualizable interface. It was picking up the wrong class  
file for it, as I remember. (probably wasn't with the assembly  
plugin, now that I think of it...)

-john


On Jul 13, 2007, at 10:11 AM, Mark Hobson wrote:

> On 13/07/07, John Casey <jd...@commonjava.org> wrote:
>> I you implement LogEnabled or extend AbstractLogEnabled (I prefer the
>> former), plexus will populate the logger when it initializes the
>> component, prior to use.
>
> This is what I would have expected - I did try this initially but the
> logger ended up being null.  This is within the dependency plugin
> which has issues regarding the plexus container api/default
> dependencies, so perhaps this is causing plexus to not recognise
> LogEnabled.
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

---
John Casey
Committer and PMC Member, Apache Maven
mail: jdcasey at commonjava dot org
blog: http://www.ejlife.net/blogs/john



Re: Logging in components

Posted by Mark Hobson <ma...@gmail.com>.
On 13/07/07, John Casey <jd...@commonjava.org> wrote:
> I you implement LogEnabled or extend AbstractLogEnabled (I prefer the
> former), plexus will populate the logger when it initializes the
> component, prior to use.

This is what I would have expected - I did try this initially but the
logger ended up being null.  This is within the dependency plugin
which has issues regarding the plexus container api/default
dependencies, so perhaps this is causing plexus to not recognise
LogEnabled.

Mark

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


Re: Logging in components

Posted by John Casey <jd...@commonjava.org>.
I you implement LogEnabled or extend AbstractLogEnabled (I prefer the  
former), plexus will populate the logger when it initializes the  
component, prior to use.

HTH,

-john


On Jul 13, 2007, at 9:13 AM, Mark Hobson wrote:

> Hi,
>
> I want to add some debug logging to the dependency tree shared
> component which is used in the dependency:tree goal.  Is the preferred
> way for the component to extend LogEnabled, and if so, is there any
> way of getting the log set automatically by plexus?  The alternative
> would be for the mojo to explicit set the log itself, but then I'd
> have to adapt the mojo Log to a plexus Logger.
>
> Cheers,
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

---
John Casey
Committer and PMC Member, Apache Maven
mail: jdcasey at commonjava dot org
blog: http://www.ejlife.net/blogs/john