Re: Logging in plugins right now

2012-11-20 Thread Dennis Lundberg
On 2012-11-20 04:13, Jason van Zyl wrote:
> 
> On Nov 19, 2012, at 8:44 PM, Benson Margulies  wrote:
> 
>> On Mon, Nov 19, 2012 at 8:34 PM, Jason van Zyl  wrote:
>>>
>>> On Nov 19, 2012, at 8:29 PM, Benson Margulies  wrote:
>>>
 Do we have, right now, either:

 1) A way of mapping java-commons-logging to the mojo log API, or

>>>
>>> Do you mean commons-logging, JUL, or both? There are ways to adapt both to 
>>> SLF4J.
>>
>> The former, but it doesn't matter.
>>
>> If I add a dependency, in a plugin, that uses commons-logging, I want
>> to map the log messages from that dependency to the mojo log, so that
>> they look right even with Maven 3.0.x.
> 
> If memory serves, commons-logging will look for Log4j, then JUL, and if 
> neither of those are present then a NoOp implementation is selected. So in 
> our case, most people being 1.4+, the JDK implementation will be chosen and 
> the default for JUL is to output to the console so they will come out with 
> the rest of the output but the formatting will be slightly different. 
> Probably nothing horrible.

It's very easy for an application to explicitly use the simplelog
implementation in commons-logging. The formatting for it can be tweaked
to look like Maven's normal console logging. No added dependency is
needed, just a couple of properties files. I can help to set this up.

>> I appreciate that as of 3.1 I
>> can just use the usual jcl-over-slf4j (or jul or whatever) and the
>> messages will end up in the right-ish place, though not associated
>> with the mojo. I was hoping for
>>
> 
> No mojo specific logging is present right now. It's just all using SLF4J but 
> no real hierarchy, or markers have been established. So for 3.1.0 and before 
> the output is going to look more or less the same.
> 
>>plugin code calls (e.g.) CXF code calls SLF4J calls
>> something-we-lack calls mojo log calls SLF4J calls SLF4J-simple (in
>> 3.1)
>>
>> and
>>
>>
>>  plugin code calls (e.g.) CXF code calls SLF4J calls
>> something-we-lack calls mojo log calls whatever we have today (in 2.x
>> or 3.0.x)
>>
> 
> In both cases now it's just all going to come out on the console.
> 
>>
>>
>>>
 2) A way of mapping slf4j to the mojo log?

>>>
>>> Mojo.getLog() feeds into SLF4J with the code on trunk.
>>>
 ?

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

>>>
>>> Thanks,
>>>
>>> Jason
>>>
>>> --
>>> Jason van Zyl
>>> Founder & CTO, Sonatype
>>> Founder,  Apache Maven
>>> http://twitter.com/jvanzyl
>>> -
>>>
>>> In short, man creates for himself a new religion of a rational
>>> and technical order to justify his work and to be justified in it.
>>>
>>>  -- Jacques Ellul, The Technological Society
>>>
>>>
>>>
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
>> For additional commands, e-mail: dev-h...@maven.apache.org
>>
> 
> Thanks,
> 
> Jason
> 
> --
> Jason van Zyl
> Founder & CTO, Sonatype
> Founder,  Apache Maven
> http://twitter.com/jvanzyl
> -
> 
> Three people can keep a secret provided two of them are dead.
> 
>  -- Benjamin Franklin
> 
> 
> 
> 
> 
> 


-- 
Dennis Lundberg

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



Re: Logging in plugins right now

2012-11-19 Thread Jason van Zyl

On Nov 19, 2012, at 8:44 PM, Benson Margulies  wrote:

> On Mon, Nov 19, 2012 at 8:34 PM, Jason van Zyl  wrote:
>> 
>> On Nov 19, 2012, at 8:29 PM, Benson Margulies  wrote:
>> 
>>> Do we have, right now, either:
>>> 
>>> 1) A way of mapping java-commons-logging to the mojo log API, or
>>> 
>> 
>> Do you mean commons-logging, JUL, or both? There are ways to adapt both to 
>> SLF4J.
> 
> The former, but it doesn't matter.
> 
> If I add a dependency, in a plugin, that uses commons-logging, I want
> to map the log messages from that dependency to the mojo log, so that
> they look right even with Maven 3.0.x.

If memory serves, commons-logging will look for Log4j, then JUL, and if neither 
of those are present then a NoOp implementation is selected. So in our case, 
most people being 1.4+, the JDK implementation will be chosen and the default 
for JUL is to output to the console so they will come out with the rest of the 
output but the formatting will be slightly different. Probably nothing horrible.

> I appreciate that as of 3.1 I
> can just use the usual jcl-over-slf4j (or jul or whatever) and the
> messages will end up in the right-ish place, though not associated
> with the mojo. I was hoping for
> 

No mojo specific logging is present right now. It's just all using SLF4J but no 
real hierarchy, or markers have been established. So for 3.1.0 and before the 
output is going to look more or less the same.

>plugin code calls (e.g.) CXF code calls SLF4J calls
> something-we-lack calls mojo log calls SLF4J calls SLF4J-simple (in
> 3.1)
> 
> and
> 
> 
>  plugin code calls (e.g.) CXF code calls SLF4J calls
> something-we-lack calls mojo log calls whatever we have today (in 2.x
> or 3.0.x)
> 

In both cases now it's just all going to come out on the console.

> 
> 
>> 
>>> 2) A way of mapping slf4j to the mojo log?
>>> 
>> 
>> Mojo.getLog() feeds into SLF4J with the code on trunk.
>> 
>>> ?
>>> 
>>> -
>>> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
>>> For additional commands, e-mail: dev-h...@maven.apache.org
>>> 
>> 
>> Thanks,
>> 
>> Jason
>> 
>> --
>> Jason van Zyl
>> Founder & CTO, Sonatype
>> Founder,  Apache Maven
>> http://twitter.com/jvanzyl
>> -
>> 
>> In short, man creates for himself a new religion of a rational
>> and technical order to justify his work and to be justified in it.
>> 
>>  -- Jacques Ellul, The Technological Society
>> 
>> 
>> 
>> 
>> 
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org
> 

Thanks,

Jason

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

Three people can keep a secret provided two of them are dead.

 -- Benjamin Franklin







Re: Logging in plugins right now

2012-11-19 Thread Benson Margulies
On Mon, Nov 19, 2012 at 8:34 PM, Jason van Zyl  wrote:
>
> On Nov 19, 2012, at 8:29 PM, Benson Margulies  wrote:
>
>> Do we have, right now, either:
>>
>> 1) A way of mapping java-commons-logging to the mojo log API, or
>>
>
> Do you mean commons-logging, JUL, or both? There are ways to adapt both to 
> SLF4J.

The former, but it doesn't matter.

If I add a dependency, in a plugin, that uses commons-logging, I want
to map the log messages from that dependency to the mojo log, so that
they look right even with Maven 3.0.x. I appreciate that as of 3.1 I
can just use the usual jcl-over-slf4j (or jul or whatever) and the
messages will end up in the right-ish place, though not associated
with the mojo. I was hoping for

plugin code calls (e.g.) CXF code calls SLF4J calls
something-we-lack calls mojo log calls SLF4J calls SLF4J-simple (in
3.1)

and


  plugin code calls (e.g.) CXF code calls SLF4J calls
something-we-lack calls mojo log calls whatever we have today (in 2.x
or 3.0.x)



>
>> 2) A way of mapping slf4j to the mojo log?
>>
>
> Mojo.getLog() feeds into SLF4J with the code on trunk.
>
>> ?
>>
>> -
>> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
>> For additional commands, e-mail: dev-h...@maven.apache.org
>>
>
> Thanks,
>
> Jason
>
> --
> Jason van Zyl
> Founder & CTO, Sonatype
> Founder,  Apache Maven
> http://twitter.com/jvanzyl
> -
>
> In short, man creates for himself a new religion of a rational
> and technical order to justify his work and to be justified in it.
>
>   -- Jacques Ellul, The Technological Society
>
>
>
>
>

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



Re: Logging in plugins right now

2012-11-19 Thread Jason van Zyl

On Nov 19, 2012, at 8:29 PM, Benson Margulies  wrote:

> Do we have, right now, either:
> 
> 1) A way of mapping java-commons-logging to the mojo log API, or
> 

Do you mean commons-logging, JUL, or both? There are ways to adapt both to 
SLF4J.

> 2) A way of mapping slf4j to the mojo log?
> 

Mojo.getLog() feeds into SLF4J with the code on trunk.

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

Thanks,

Jason

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

In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.

  -- Jacques Ellul, The Technological Society







Logging in plugins right now

2012-11-19 Thread Benson Margulies
Do we have, right now, either:

1) A way of mapping java-commons-logging to the mojo log API, or

2) A way of mapping slf4j to the mojo log?

?

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