CVS: plexus-container-new/src/java/org/apache/plexus/logging LoggerManagerFactory.java,1.1,1.2
[email protected] Sun, 27 Apr 2003 23:35:39 -0500
| Newsgroups | gmane.comp.java.plexus.devel |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/plexus/plexus-container-new/src/java/org/apache/plexus/logging
In directory eng.werken.com:/tmp/cvs-serv12233/src/java/org/apache/plexus/logging
Modified Files:
LoggerManagerFactory.java
Log Message:
o The factories are now completely responsible for setting up a base entity.
So for each of the factories I've tried to follow the pattern of sending
in the defaultConfiguration, configuration, loggerManager, classLoader and
then any other parameters that the factory requires to setup the base
entity.
Index: LoggerManagerFactory.java
===================================================================
RCS file: /cvsroot/plexus/plexus-container-new/src/java/org/apache/plexus/logging/LoggerManagerFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- LoggerManagerFactory.java 27 Apr 2003 20:20:03 -0000 1.1
+++ LoggerManagerFactory.java 28 Apr 2003 04:35:37 -0000 1.2
@@ -8,12 +8,24 @@
public class LoggerManagerFactory
extends AbstractPlexusFactory
{
- public static LoggerManager create( Configuration configuration, ClassLoader classLoader )
+ public static LoggerManager create( Configuration defaultConfiguration,
+ Configuration configuration,
+ ClassLoader classLoader )
throws Exception
{
+ String implementation;
+
+ if ( configuration.getChild( "logging", false ) != null )
+ {
+ implementation = configuration.getChild( "logging" ).getChild( "implementation" ).getValue();
+ }
+ else
+ {
+ implementation = defaultConfiguration.getChild( "logging" ).getChild( "implementation" ).getValue();
+ }
+
LoggerManager lm =
- (LoggerManager) getInstance( configuration.getChild( "implementation" ).getValue(),
- classLoader );
+ (LoggerManager) getInstance( implementation, classLoader );
lm.configure( configuration );
lm.initialize();