You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Barrie Treloar <ba...@gmail.com> on 2009/03/27 01:29:46 UTC

AbstractMojo.getLog vs LogEnabled.enableLogging (found in maven-eclipse-plugin)

EclipsePlugin extends AbstractIdeSupportMojo
AbstractIdeSupportMojo extends AbstractMojo implements LogEnabled
AbstractMojo has getLog()
LogEnabled has enableLogging()

Which logger should be used?

getLog() from AbstractMojo
or
the logger passed in via enableLogging()

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


Re: AbstractMojo.getLog vs LogEnabled.enableLogging (found in maven-eclipse-plugin)

Posted by Barrie Treloar <ba...@gmail.com>.
> If you want to log in Plexus there is no static logging. You either extend
> AbstractLogEnabled to have logging capabilities or you inject a Logger.
>
> Mojo has it's own logging implementation to decouple it from Plexus even
> though the default implementation wraps a Plexus logger.
>
> Therefore in a Mojo implementation don't use something Plexus specific.

Appreciate that.
Since it is a Mojo I'll look into removing it.

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


Re: AbstractMojo.getLog vs LogEnabled.enableLogging (found in maven-eclipse-plugin)

Posted by Jason van Zyl <jv...@sonatype.com>.
On 27-Mar-09, at 2:10 PM, Barrie Treloar wrote:

> On Sat, Mar 28, 2009 at 1:59 AM, Jason van Zyl  
> <jv...@sonatype.com> wrote:
>>
>> On 26-Mar-09, at 5:29 PM, Barrie Treloar wrote:
>>
>>> EclipsePlugin extends AbstractIdeSupportMojo
>>> AbstractIdeSupportMojo extends AbstractMojo implements LogEnabled
>>> AbstractMojo has getLog()
>>> LogEnabled has enableLogging()
>>>
>>> Which logger should be used?
>>>
>>> getLog() from AbstractMojo
>>> or
>>
>> Use the getLog() as that's the plugin api. Enable logging is Plexus  
>> specific
>> so you should avoid that if you can.
>
> Are you able to elaborate on why Plexus needs it?
> I'm contemplating removing it to see what happens.
>

If you want to log in Plexus there is no static logging. You either  
extend AbstractLogEnabled to have logging capabilities or you inject a  
Logger.

Mojo has it's own logging implementation to decouple it from Plexus  
even though the default implementation wraps a Plexus logger.

Therefore in a Mojo implementation don't use something Plexus specific.

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

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
----------------------------------------------------------

happiness is like a butterfly: the more you chase it, the more it will
elude you, but if you turn your attention to other things, it will come
and sit softly on your shoulder ...

  -- Thoreau


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


Re: AbstractMojo.getLog vs LogEnabled.enableLogging (found in maven-eclipse-plugin)

Posted by Barrie Treloar <ba...@gmail.com>.
On Sat, Mar 28, 2009 at 1:59 AM, Jason van Zyl <jv...@sonatype.com> wrote:
>
> On 26-Mar-09, at 5:29 PM, Barrie Treloar wrote:
>
>> EclipsePlugin extends AbstractIdeSupportMojo
>> AbstractIdeSupportMojo extends AbstractMojo implements LogEnabled
>> AbstractMojo has getLog()
>> LogEnabled has enableLogging()
>>
>> Which logger should be used?
>>
>> getLog() from AbstractMojo
>> or
>
> Use the getLog() as that's the plugin api. Enable logging is Plexus specific
> so you should avoid that if you can.

Are you able to elaborate on why Plexus needs it?
I'm contemplating removing it to see what happens.

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


Re: AbstractMojo.getLog vs LogEnabled.enableLogging (found in maven-eclipse-plugin)

Posted by Jason van Zyl <jv...@sonatype.com>.
On 26-Mar-09, at 5:29 PM, Barrie Treloar wrote:

> EclipsePlugin extends AbstractIdeSupportMojo
> AbstractIdeSupportMojo extends AbstractMojo implements LogEnabled
> AbstractMojo has getLog()
> LogEnabled has enableLogging()
>
> Which logger should be used?
>
> getLog() from AbstractMojo
> or

Use the getLog() as that's the plugin api. Enable logging is Plexus  
specific so you should avoid that if you can.

> the logger passed in via enableLogging()
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
----------------------------------------------------------

You are never dedicated to something you have complete confidence in.
No one is fanatically shouting that the sun is going to rise tomorrow.
They know it is going to rise tomorrow. When people are fanatically
dedicated to political or religious faiths or any other kind of
dogmas or goals, it's always because these dogmas or
goals are in doubt.

   -- Robert Pirzig, Zen and the Art of Motorcycle Maintenance


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