Package org.osgi.service.log

Examples of org.osgi.service.log.LogService


     * @param msg Log message
     */
    void log(int level, String msg) {
        ServiceReference srLog = bc.getServiceReference(logServiceName);
        if (srLog != null) {
            LogService sLog = (LogService) bc.getService(srLog);
            if (sLog != null) {
                sLog.log(level, msg);
            }
            bc.ungetService(srLog);
        }
    }
View Full Code Here


     */
    void log(int level, String msg, Throwable t) {
        ServiceReference srLog = bc
                .getServiceReference("org.osgi.service.log.LogService");
        if (srLog != null) {
            LogService sLog = (LogService) bc.getService(srLog);
            if (sLog != null) {
                sLog.log(level, msg, t);
            }
            bc.ungetService(srLog);
        }
    }
View Full Code Here

   * Log message via specified BundleContext
   */
  static void logBC(BundleContext bc, int level, String msg, Throwable t) {
    ServiceReference sr = bc.getServiceReference(LogService.class.getName());
    if (sr != null) {
      LogService log = (LogService)bc.getService(sr);
      if (log != null) {
        log.log(level, msg, t);
        bc.ungetService(sr);
      }
    }
  }
View Full Code Here

  }

  public static void log(int level, String message, Throwable t) {
    if (logTracker == null)
      return;
    LogService log = (LogService) logTracker.getService();
    if (log == null)
      return;
    if (t == null) {
      log.log(level, message);
    } else {
      log.log(level, message, t);
    }
  }
View Full Code Here

  }

  public static void log(int level, String msg, Exception e) {
    ServiceReference srLog = bc.getServiceReference(logServiceName);
    if (srLog != null) {
      LogService sLog = (LogService)bc.getService(srLog);
      if (sLog != null) {
        if(e != null) {
          sLog.log(level, msg, e);
        } else {
          sLog.log(level, msg);
        }
      }
      bc.ungetService(srLog);
    }
  }
View Full Code Here

  private void log(int level, String message)
  {
    ServiceReference sRef =
      bc.getServiceReference(LogService.class.getName());
    if (sRef != null) {
      LogService log = (LogService) bc.getService(sRef);
      if (log != null) {
        log.log(level, message);
      }
      bc.ungetService(sRef);
    }
  }
View Full Code Here

    log(level, msg, null);
  }
 
  public void log(int level, String msg, Exception e) {
    if(logTracker != null) {
      LogService sLog = (LogService)logTracker.getService();
      if (sLog != null) {
        if (e == null) {
          sLog.log(level, msg);
        } else {
          sLog.log(level, msg, e);
        }
        return;
      }
    }
    System.out.println("LOG " + level + ": " + msg);
View Full Code Here

    }

    public void log(int level, String msg, Exception e) {
        ServiceReference srLog = bc.getServiceReference(logServiceName);
        if (srLog != null) {
            LogService sLog = (LogService) bc.getService(srLog);
            if (sLog != null) {
                if (e == null) {
                    sLog.log(level, msg);
                } else {
                    sLog.log(level, msg, e);
                }
            }
            bc.ungetService(srLog);
        }
    }
View Full Code Here

   * not available.
   */
  void log(String msg, Throwable t) {
    int level = t == null ? LogService.LOG_INFO : LogService.LOG_WARNING;

    LogService log = (LogService)logTracker.getService();
    if(log == null) {
      System.out.println("[dirdeployer " + level + "] " + msg);
      if(t != null) {
        t.printStackTrace();
      }
    } else {
      log.log(level, msg, t);
    }
  }
View Full Code Here

    void log(int level, String msg) {
        try {
            ServiceReference srLog = bc.getServiceReference(logServiceName);
            if (srLog != null) {
                LogService sLog = (LogService) bc.getService(srLog);
                if (sLog != null) {
                    sLog.log(level, msg);
                }
                bc.ungetService(srLog);
            }
        } catch (IllegalStateException exp) {
            // if the thread has survied the stop of the bundle we get this
View Full Code Here

TOP

Related Classes of org.osgi.service.log.LogService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.