You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Vincent Siveton (JIRA)" <ji...@codehaus.org> on 2007/08/04 13:19:13 UTC
[jira] Created: (DOXIA-145) Adding logger feature
Adding logger feature
---------------------
Key: DOXIA-145
URL: http://jira.codehaus.org/browse/DOXIA-145
Project: Maven Doxia
Issue Type: New Feature
Components: Core, Modules, Sink API
Reporter: Vincent Siveton
Fix For: 1.0-beta-1
Doxia needs to have logger capability insides
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (DOXIA-145) Adding logger feature
Posted by "Vincent Siveton (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/DOXIA-145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_123189 ]
Vincent Siveton commented on DOXIA-145:
---------------------------------------
Basically, we need to improve logging in Sink, Parser and Macro.
Using Plexus AbstractLogEnabled seems the better way i.e.
{noformat}
public class SinkAdapter
extends AbstractLogEnabled
implements Sink
{}
{noformat}
The actual problem is that Sinks are not used as plexus components. Instantiation is direct, i.e.:
{noformat}
MySink sink = new Sink( aWriter );
{noformat}
due NPE when calling getLogger()
A solution could be to refactor all sinks, parser and macro to use them as components.
We could also need to specify a logger, i.e.
{noformat}
public class SinkAdapter
extends AbstractLogEnabled
implements Sink
{
private Logger logger;
/** {@inheritDoc} */
public final Logger getLogger()
{
if ( logger == null )
{
if ( super.getLogger() != null )
{
logger = super.getLogger();
}
else
{
logger = new Slf4jLogger( Logger.LEVEL_DEBUG, LoggerFactory.getLogger( getClass() ));
}
}
return logger;
}
public final void setLogger( Logger logger )
{
this.logger = logger;
}
}
{noformat}
And specify the current logger during the instantiation, i.e.
{noformat}
MySink sink = new Sink( aWriter );
sink.setLogger( getLogger );
{noformat}
Other ideas?
> Adding logger feature
> ---------------------
>
> Key: DOXIA-145
> URL: http://jira.codehaus.org/browse/DOXIA-145
> Project: Maven Doxia
> Issue Type: New Feature
> Components: Core, Modules, Sink API
> Reporter: Vincent Siveton
> Fix For: 1.0-beta-1
>
>
> Doxia needs to have logger capability insides
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (DOXIA-145) Adding logger feature
Posted by "Vincent Massol (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/DOXIA-145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_128193 ]
Vincent Massol commented on DOXIA-145:
--------------------------------------
Remark: I don't think adding a enableLoggin() interface to the Sink API is a good solution but I understand it may be an interim one. From an external users of the Doxia API having to implement an enableLogging() method when all I do is provide an implementation for my Sink is strange. I don't want to log anything in my Sink (or if I do it's with my own logging subsystem).
> Adding logger feature
> ---------------------
>
> Key: DOXIA-145
> URL: http://jira.codehaus.org/browse/DOXIA-145
> Project: Maven Doxia
> Issue Type: New Feature
> Components: Core, Modules, Sink API
> Reporter: Vincent Siveton
> Assignee: Lukas Theussl
> Fix For: 1.0-beta-1
>
> Attachments: DOXIA-145.patch
>
>
> Doxia needs to have logger capability insides
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (DOXIA-145) Adding logger feature
Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/DOXIA-145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lukas Theussl closed DOXIA-145.
-------------------------------
Assignee: Lukas Theussl
Resolution: Fixed
Closing as it works for me, but obviously needs testing on a wider basis.
> Adding logger feature
> ---------------------
>
> Key: DOXIA-145
> URL: http://jira.codehaus.org/browse/DOXIA-145
> Project: Maven Doxia
> Issue Type: New Feature
> Components: Core, Modules, Sink API
> Reporter: Vincent Siveton
> Assignee: Lukas Theussl
> Fix For: 1.0-beta-1
>
> Attachments: DOXIA-145.patch
>
>
> Doxia needs to have logger capability insides
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (DOXIA-145) Adding logger feature
Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/DOXIA-145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lukas Theussl updated DOXIA-145:
--------------------------------
Attachment: DOXIA-145.patch
After some more discussion, here is my proposition: only DefaultDoxia extends AbstractLogEnabled. Sink, parser and macro have independent instances of a logger that they inherit from a super interface (note: api changes!) so in principle they can be set independently. In practice it's the parser that should propagate its logger to the sink and macros that it's using. I have put the logging package into a separate module to avoid a circular dependency, since both sink and parser should be LogEnabled.
I have tested by adding a simple xdoc to the site-renderer test that contains an invalid element, one can see that the plexus logger injected in DefaultDoxia is used indeed.
> Adding logger feature
> ---------------------
>
> Key: DOXIA-145
> URL: http://jira.codehaus.org/browse/DOXIA-145
> Project: Maven Doxia
> Issue Type: New Feature
> Components: Core, Modules, Sink API
> Reporter: Vincent Siveton
> Fix For: 1.0-beta-1
>
> Attachments: DOXIA-145.patch
>
>
> Doxia needs to have logger capability insides
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (DOXIA-145) Adding logger feature
Posted by "Vincent Siveton (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/DOXIA-145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_123785 ]
Vincent Siveton commented on DOXIA-145:
---------------------------------------
Fixed in r62806.
Lukas, could you review it? Thanks.
> Adding logger feature
> ---------------------
>
> Key: DOXIA-145
> URL: http://jira.codehaus.org/browse/DOXIA-145
> Project: Maven Doxia
> Issue Type: New Feature
> Components: Core, Modules, Sink API
> Reporter: Vincent Siveton
> Fix For: 1.0-beta-1
>
> Attachments: DOXIA-145.patch
>
>
> Doxia needs to have logger capability insides
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira