You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "McEligot, Sean (contractor)" <Mc...@MTMC.ARMY.MIL> on 2002/06/18 22:37:48 UTC

RE: [PATCH] Bug 9462 make default initialization available as a p ubli c method

> Thanks for your patch. However, the LogManager static initializer is
> for internal use only. There is no intention to export it.

No Problem. How about adding a public method to Category (or Logger) that
calls a package private method in LogManager:
--- Category.orig	2002-06-13 05:05:57.000000000 -0400
+++ Category.java	2002-06-18 16:38:46.000000000 -0400
@@ -306,7 +306,9 @@
       forcedLog(FQCN, Level.ERROR, message, t);
 
   }
-
+	public static void runDefaultInitialization()  {
+  	LogManager.runDefaultInitialization();
+	}
 
   /**
      If the named category exists (in the default hierarchy) then it
--- LogManager.orig	2002-06-17 14:35:23.000000000 -0400
+++ LogManager.java	2002-06-18 16:39:40.000000000 -0400
@@ -109,6 +109,9 @@
   static private RepositorySelector repositorySelector;
 
   static {
+    runDefaultInitialization();
+	}
+  static void runDefaultInitialization() {
     // By default we use a DefaultRepositorySelector which always returns
'h'.
     Hierarchy h = new Hierarchy(new RootCategory((Level) Level.DEBUG));
     repositorySelector = new DefaultRepositorySelector(h);


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [PATCH] Bug 9462 make default initialization available as a p ubli c method

Posted by Ceki Gülcü <ce...@qos.ch>.
Making runDefaultInitialization callable from a public method is the same 
as exporting it. :-)

At 16:37 18.06.2002 -0400, you wrote:
> > Thanks for your patch. However, the LogManager static initializer is
> > for internal use only. There is no intention to export it.
>
>No Problem. How about adding a public method to Category (or Logger) that
>calls a package private method in LogManager:
>--- Category.orig       2002-06-13 05:05:57.000000000 -0400
>+++ Category.java       2002-06-18 16:38:46.000000000 -0400
>@@ -306,7 +306,9 @@
>        forcedLog(FQCN, Level.ERROR, message, t);
>
>    }
>-
>+       public static void runDefaultInitialization()  {
>+       LogManager.runDefaultInitialization();
>+       }
>
>    /**
>       If the named category exists (in the default hierarchy) then it
>--- LogManager.orig     2002-06-17 14:35:23.000000000 -0400
>+++ LogManager.java     2002-06-18 16:39:40.000000000 -0400
>@@ -109,6 +109,9 @@
>    static private RepositorySelector repositorySelector;
>
>    static {
>+    runDefaultInitialization();
>+       }
>+  static void runDefaultInitialization() {
>      // By default we use a DefaultRepositorySelector which always returns
>'h'.
>      Hierarchy h = new Hierarchy(new RootCategory((Level) Level.DEBUG));
>      repositorySelector = new DefaultRepositorySelector(h);
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>

--
Ceki


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>