Merge "Fixed inappropriate uses of log level INFO"
authorAlessandro Boch <aboch@cisco.com>
Wed, 22 Jan 2014 23:40:53 +0000 (23:40 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 22 Jan 2014 23:40:53 +0000 (23:40 +0000)
1  2 
opendaylight/logging/bridge/src/main/java/org/opendaylight/controller/logging/bridge/internal/Activator.java

@@@ -50,15 -50,14 +50,15 @@@ public class Activator implements Bundl
                  if (reader == null) {
                      this.log.error("Cannot register the LogListener because "
                              + "cannot retrieve LogReaderService");
 -                }
 -                reader.addLogListener(this.listener);
 -                // Now lets walk all the exiting messages
 -                Enumeration<LogEntry> entries = reader.getLog();
 -                if (entries != null) {
 -                    while (entries.hasMoreElements()) {
 -                        LogEntry entry = (LogEntry) entries.nextElement();
 -                        this.listener.logged(entry);
 +                } else {
 +                    reader.addLogListener(this.listener);
 +                    // Now lets walk all the exiting messages
 +                    Enumeration<LogEntry> entries = reader.getLog();
 +                    if (entries != null) {
 +                        while (entries.hasMoreElements()) {
 +                            LogEntry entry = entries.nextElement();
 +                            this.listener.logged(entry);
 +                        }
                      }
                  }
  
@@@ -77,7 -76,7 +77,7 @@@
                          log.warn("Invalid policy name \"{}\", defaulting to {}", policy, handler);
                      }
                  }
-                 log.info("Setting uncaught exception policy to {}", handler);
+                 log.trace("Setting uncaught exception policy to {}", handler);
                  Thread.setDefaultUncaughtExceptionHandler(handler);
  
                  /*
  
      @Override
      public void stop(BundleContext context) {
 -        ServiceReference service = null;
 -        service = context.getServiceReference(LogReaderService.class.getName());
 -        if (service != null) {
 -            LogReaderService reader = (LogReaderService) service;
 +        ServiceReference serviceRef = context.getServiceReference(
 +                LogReaderService.class.getName());
 +        if (serviceRef != null) {
 +            LogReaderService reader = (LogReaderService) context.getService(serviceRef);
              reader.removeLogListener(this.listener);
          }
          if (this.shutdownHandler != null) {