On Apr 18, 2007, at 10:31 PM, Paul Smith wrote:


Maybe you could fake out the getLogger() calls like

      private static final class LogLogger {
           public void debug(final String msg) {
                LogLog.debug(msg);
           }
          public void warn(final String msg) {
                LogLog.warn(msg);
          }
         public void error(final String msg, final Throwable ex) {
               LogLog.error(msg, ex);
        }
     }
     private static final LogLogger getLogger() {
        return new LogLogger();
     }


Done, nice suggestion.  Bit clunky, but works for now.


Did my second suggestion, replacing that who chunk with

private static final LogLog getLogger() {
     return new LogLog();
}

not work? Actually, since they are static methods, you could probably get away with returning null, but I thought that might be pushing it too much.




and access the "sequence number" through another private method:

    private static long getSequenceNumber(final LoggingEvent event) {
         return 0;
    }


I left this out. The discussion about what to do with sequence numbers and the 1.2 tree is probably best left for a future thread.


In DBReceiverJob.java, I'm unclear why you are doing:

Object msg = null;
...
msg = rs.getString(3);

instead of:

Object msg = rs.getString(3);


I tried to leave the diffs as simple as possible. You are correct; I just tried to limit the amount of text change.


My reading the diffs had both the declaration and assignment as new code, so don't see how the split minimizes code change.


From my code reading PluginRegistry is always accessed by code like:


LoggerRepository repo = LogManager.getLoggerRepository();
if (repo instanceof LoggerRepositoryEx) {
PluginRegistry pluginRegistry = ((LoggerRepositoryEx) repo).getPluginRegistry();
    ...


Some variation of that code appears in about 8 or 9 places. If you could replace that code with a call to a function (maybe in LogUI):


private PluginRegistry plugRegistry;

public PluginRegistry getPluginRegistry() {
     LoggerRepository repo = LogManager.getLoggerRepository();
     if (repo instanceof LoggerRepositoryEx) {
         return ((LoggerRepositoryEx) repo).getPluginRegistry();
     }
    synchronized(this) {
         if(plugRegistry == null) {
                plugRegistry = new PluginRegistry(repo);
         }
         return plugRegistry;
    }
}

(with adding PluginRegistry(LoggerRepository) constructor in the components project). That would likely get you over the initial hump until can look whether we can add the notification hooks that would be necessary to catch the repo shutdown and change notifications that plug in registry would like.









---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to