You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Slawomir Jaranowski <s....@gmail.com> on 2021/01/17 21:42:14 UTC
Logging api in plugins
Hi,
For developers logging api in plugin will can be misunderstood, we don't
have information that https://maven.apache.org/maven-logging.html is only
for maven core.
I think we should put information that plugins should only use
org.apache.maven.plugin.logging.Log and why, maybe at page:
https://maven.apache.org/developers/mojo-api-specification.html or
https://maven.apache.org/plugin-developers/common-bugs.html
Looking on org.apache.maven.plugin.logging.Log the Log has missing some
features like massage formatting to avoid string concatenation - do you
have a plan to extend it?
--
Sławomir Jaranowski
Re: Logging api in plugins
Posted by Benjamin Marwell <bm...@apache.org>.
https://maven.apache.org/maven-logging.html needs to be updated,
but also some plugins where changes were already made.
This was from slack: https://issues.apache.org/jira/browse/MNG-6931
And plugins pulling in slf4j directly happen all the time:
https://github.com/apache/maven-artifact-plugin/pull/4
The sooner the hint is on the logging page, the better (if all agree,
of course).
Am Fr., 22. Jan. 2021 um 11:30 Uhr schrieb Robert Scholte
<rf...@apache.org>:
>
> I agree that we should advice that Maven Plugins should use the provided logging API.
> I can't find the ticket anymore, but I've created one where it should be possible to scope the debug-logging for a specific goal.
> Most of the time you're interested in the debug logging of the last failed goal only.
> By doing something like -Xplugin:goal it might be possible to achieve that, but that will probably only work if plugins use the provided logging API instead of the global LoggerFactory
>
> thanks,
> Robert
> On 18-1-2021 09:35:01, Romain Manni-Bucau <rm...@gmail.com> wrote:
> Hi
>
> +1 to explicit it.
>
> About message formatting it is not critical for me and enables to switch
> the impl at will without being impl locked so maybe rather add lazy
> evaluation with lambdas like in jul.
>
> Le dim. 17 janv. 2021 à 22:42, Slawomir Jaranowski
> a écrit :
>
> > Hi,
> >
> > For developers logging api in plugin will can be misunderstood, we don't
> > have information that https://maven.apache.org/maven-logging.html is only
> > for maven core.
> >
> > I think we should put information that plugins should only use
> > org.apache.maven.plugin.logging.Log and why, maybe at page:
> > https://maven.apache.org/developers/mojo-api-specification.html or
> > https://maven.apache.org/plugin-developers/common-bugs.html
> >
> > Looking on org.apache.maven.plugin.logging.Log the Log has missing some
> > features like massage formatting to avoid string concatenation - do you
> > have a plan to extend it?
> >
> >
> > --
> > Sławomir Jaranowski
> >
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Logging api in plugins
Posted by Robert Scholte <rf...@apache.org>.
I agree that we should advice that Maven Plugins should use the provided logging API.
I can't find the ticket anymore, but I've created one where it should be possible to scope the debug-logging for a specific goal.
Most of the time you're interested in the debug logging of the last failed goal only.
By doing something like -Xplugin:goal it might be possible to achieve that, but that will probably only work if plugins use the provided logging API instead of the global LoggerFactory
thanks,
Robert
On 18-1-2021 09:35:01, Romain Manni-Bucau <rm...@gmail.com> wrote:
Hi
+1 to explicit it.
About message formatting it is not critical for me and enables to switch
the impl at will without being impl locked so maybe rather add lazy
evaluation with lambdas like in jul.
Le dim. 17 janv. 2021 à 22:42, Slawomir Jaranowski
a écrit :
> Hi,
>
> For developers logging api in plugin will can be misunderstood, we don't
> have information that https://maven.apache.org/maven-logging.html is only
> for maven core.
>
> I think we should put information that plugins should only use
> org.apache.maven.plugin.logging.Log and why, maybe at page:
> https://maven.apache.org/developers/mojo-api-specification.html or
> https://maven.apache.org/plugin-developers/common-bugs.html
>
> Looking on org.apache.maven.plugin.logging.Log the Log has missing some
> features like massage formatting to avoid string concatenation - do you
> have a plan to extend it?
>
>
> --
> Sławomir Jaranowski
>
Re: Logging api in plugins
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi
+1 to explicit it.
About message formatting it is not critical for me and enables to switch
the impl at will without being impl locked so maybe rather add lazy
evaluation with lambdas like in jul.
Le dim. 17 janv. 2021 à 22:42, Slawomir Jaranowski <s....@gmail.com>
a écrit :
> Hi,
>
> For developers logging api in plugin will can be misunderstood, we don't
> have information that https://maven.apache.org/maven-logging.html is only
> for maven core.
>
> I think we should put information that plugins should only use
> org.apache.maven.plugin.logging.Log and why, maybe at page:
> https://maven.apache.org/developers/mojo-api-specification.html or
> https://maven.apache.org/plugin-developers/common-bugs.html
>
> Looking on org.apache.maven.plugin.logging.Log the Log has missing some
> features like massage formatting to avoid string concatenation - do you
> have a plan to extend it?
>
>
> --
> Sławomir Jaranowski
>