Examples of LogService


Examples of org.osgi.service.log.LogService

  }

  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

Examples of org.osgi.service.log.LogService

  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

Examples of org.osgi.service.log.LogService

    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

Examples of org.osgi.service.log.LogService

    }

    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

Examples of org.osgi.service.log.LogService

   * 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

Examples of org.osgi.service.log.LogService

    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

Examples of org.osgi.service.log.LogService

     *            <code>null</code>.
     * @param t The <code>Throwable</code> to log along with the message. This
     *            may be <code>null</code>.
     */
    protected void log(int level, String message, Throwable t) {
        LogService log = this.log;
        if (log != null) {
            log.log(level, message, t);
        } else {
            System.err.print(level + " - " + message);
            if (t != null) {
                t.printStackTrace(System.err);
            }
View Full Code Here

Examples of org.osgi.service.log.LogService

    protected void log(int level, String message) {
        this.log(level, message, null);
    }

    protected void log(int level, String message, Throwable t) {
        LogService log = this.log;
        if (log != null) {
            if (componentContext != null) {
                log.log(componentContext.getServiceReference(), level, message,
                    t);
            } else {
                log.log(level, message, t);
            }
        }
    }
View Full Code Here

Examples of org.osgi.service.log.LogService

            this.registerMimeType(parts[0], extensions);
        }
    }

    private void log(int level, String message, Throwable t) {
        LogService log = this.logService;
        if (log != null) {
            log.log(level, message, t);
        } else {
            PrintStream out = (level == LogService.LOG_ERROR)
                    ? System.err
                    : System.out;
            out.println(message);
View Full Code Here

Examples of org.osgi.service.log.LogService

    //---------- Logging Support ----------------------------------------------
    // log to stdout or use LogService

    public static void log( int level, String message )
    {
        LogService log = ( LogService ) INSTANCE.logService.getService();
        if ( log == null )
        {
            _log( null, level, message, null );
        }
        else
        {
            log.log( level, message );
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.