> On 10/28/07, Grégory Joseph <[email protected]> wrote:
> Is there a reason to do this here, while in most other places in
> Magnolia we're using private+static loggers ?

since this is a base class we reuse for most of the version handlers is nice
to have a logger already defined that can be reused, instead of creating a
new one in any subclass.
Also, this causes log entries to be written using a specific logger per
subclass, so you can turn on debug for a specific version handler and you
immediately know who is the responsible for logging. It's pretty common to
have non static loggers for classes that are intended to be extended.

fabrizio




> Just curious
>
> g
>
> On Oct 27, 2007, at 12:15 , [EMAIL PROTECTED] wrote:
>
> > Revision12074AuthorfgiustDate2007-10-27 12:15:30 +0200 (Sat, 27 Oct
> > 2007)Log Messageminor change: a reusable logger instanceModified Paths
> > magnolia/trunk/magnolia-core/src/main/java/info/magnolia/module/
> > AbstractModuleVersionHandler.java
> > Diff
> > Modified: magnolia/trunk/magnolia-core/src/main/java/info/magnolia/
> > module/AbstractModuleVersionHandler.java (12073 => 12074)---
> > magnolia/trunk/magnolia-core/src/main/java/info/magnolia/module/
> > AbstractModuleVersionHandler.java     2007-10-26 18:06:19 UTC (rev
> > 12073) +++ magnolia/trunk/magnolia-core/src/main/java/info/magnolia/
> > module/AbstractModuleVersionHandler.java      2007-10-27 10:15:30 UTC
> > (rev 12074)@@ -35,6 +35,9 @@ import javax.jcr.RepositoryException;
> > +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /**  *
> > Implement this and register your deltas in the constructor using
> > the register method.  *@@ -46,7 +49,7 @@  */ public abstract class
> > AbstractModuleVersionHandler implements ModuleVersionHandler { -
> > private static org.slf4j.Logger log =
> > org.slf4j.LoggerFactory.getLogger
> > (AbstractModuleVersionHandler.class);+    protected Logger log =
> > LoggerFactory.getLogger(getClass());      private final Map
> > allDeltas; // <Version, Delta>
> >
>
>
> ----------------------------------------------------------------
> for list details see
> http://documentation.magnolia.info/docs/en/editor/stayupdated.html
> ----------------------------------------------------------------
>

Reply via email to