On 07.12.2012 18:32, Jason van Zyl wrote:
Kristian,

> I'm going to look at problem with the logging while embedding and
> Hervé wants to look at the SLF4J isolation.
>
> From what I understand in talking to Ceki, for each classloader SLF4J
> can be initialized so it appears theoretically possible to block the
> all SLF4J from reaching a plugin and it will still be able to
> initialized its own SLF4J system though it will not be connected to
> the core's.
>
> So then it's a matter of deciding on sensible defaults and I agree
> with Anders here in that the default should be to pass on the core's
> SLF4J implementation. I think exceptional cases should use a flag for
> exceptional cases. This still will not help Sonar today but we can
> also add some heuristics to help plugins like the Sonar plugin. If we
> inspect the dependencies and see SLF4J is there we can block SLF4J
> from the plugin's classloader. I'm not sure yet how this will work for
> Mojo.log() or injected loggers but that might not matter for plugins
> that get no SLF4J system from the core because its doing it's own
> thing.

The above seems very reasonable.

I hesitate to bring up another angle to this already heated debate. If
it were up to me which it clearly is not, I'd go with exporting
slf4j-api and the underlying logging framework to all plugins without
hindrance. This would translate into the following "worse-is-better"
[1] logging policy:

As of 3.1.0. Maven exports its SLF4J logging environment to its
plugins. Plugins are encouraged to use this SLF4J logging
environment. They may attempt to configure this environment but should
not blindly assume that the underlying logging framework is the
default logging framework shipping with Maven.

This policy would break the current Sonar plugin. Although I imagine a
new version of Sonar would be released within weeks including the
relevant fix. After a short adaptation period, I'd expect the rare
plugins doing their own logging to fall in line with the
"worse-is-better" logging policy outlined above.

The alternative policy outlined by Jason while offering compatibility,
would be murkier, at least to the uninitiated.

[1] http://en.wikipedia.org/wiki/Worse_is_better

> Hervé I will assume you're looking at this. Let me know if you need
> any help.
>
> I don't plan on introducing a logging framework in this
> version. That's a subsequent discussion.


--
Ceki
65% of statistics are made up on the spot

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

Reply via email to