Package org.eclipse.osgi.framework.log

Examples of org.eclipse.osgi.framework.log.FrameworkLog


    ServiceReference ref = null;
    try {
      ref = bc.getServiceReference(FrameworkLog.class.getName());
      if (ref == null)
        return;
      FrameworkLog log = (FrameworkLog) context.getService(ref);
      if (log != null)
        log.log(entry);
    } finally {
      if (ref != null)
        bc.ungetService(ref);
    }
  }
View Full Code Here


            }
        }
    }

    public void log(SVNLogType logType, String message, Level logLevel) {
        FrameworkLog log = myActivator.getFrameworkLog();
        if (log == null) {
            return;
        }
        if (message != null) {
            int level = getSeverity(logLevel);
            if (level >= 0) {
                message = getMessage(logType, message);
                FrameworkLogEntry entry = myActivator.createFrameworkLogEntry(FrameworkEvent.ERROR, message, null);
                if (entry != null) {
                    log.log(entry);
                }
            }
        }
    }
View Full Code Here

    return new FrameworkLogEntry(status.getPlugin(), status.getSeverity(), status.getCode(), status.getMessage(), stackCode, t, children);
  }
 
  public static void log(IStatus status) {
    FrameworkLog log = Activator.getFrameworkLog();
    if (log != null) {
      log.log(getLog(status));
    } else {
      System.out.println(status.getMessage());
      if (status.getException() != null)
        status.getException().printStackTrace();
    }
View Full Code Here

    Policy.setLog(new ILogger() {

      public void log(IStatus status) {
        ServiceTracker frameworkLogTracker = _frameworkLogTracker;
        FrameworkLog log = frameworkLogTracker == null ? null : (FrameworkLog) frameworkLogTracker.getService();
        if (log != null) {
          log.log(createLogEntry(status));
        } else {
          // fall back to System.err
          System.err.println(status.getPlugin() + " - " + status.getCode() + " - " + status.getMessage())//$NON-NLS-1$//$NON-NLS-2$
          if( status.getException() != null ) {
            status.getException().printStackTrace(System.err);
View Full Code Here

    Policy.setLog(new ILogger() {

      public void log(IStatus status) {
        ServiceTracker frameworkLogTracker = _frameworkLogTracker;
        FrameworkLog log = frameworkLogTracker == null ? null : (FrameworkLog) frameworkLogTracker.getService();
        if (log != null) {
          log.log(createLogEntry(status));
        } else {
          // fall back to System.err
          System.err.println(status.getPlugin() + " - " + status.getCode() + " - " + status.getMessage())//$NON-NLS-1$//$NON-NLS-2$
          if( status.getException() != null ) {
            status.getException().printStackTrace(System.err);
View Full Code Here

  public static void log(IStatus status) {
    if (logTracker == null) {
      logTracker = new ServiceTracker(getContext(), FrameworkLog.class.getName(), null);
      logTracker.open();
    }
    FrameworkLog log = (FrameworkLog) logTracker.getService();
    log.log(getEntry(status));
  }
View Full Code Here

    assertLocationInitialized();
    return location;
  }

  public IPath getLogLocation() throws IllegalStateException {
    FrameworkLog log = Activator.getDefault().getFrameworkLog();
    if (log == null)
      return null;
    return new Path(log.getFile().getAbsolutePath());
  }
View Full Code Here

    // set the log file location now that we created the data area
    IPath path = location.append(F_META_AREA).append(F_LOG);
    try {
      Activator activator = Activator.getDefault();
      if (activator != null) {
        FrameworkLog log = activator.getFrameworkLog();
        if (log != null)
          log.setFile(path.toFile(), true);
        else if (debug())
          System.out.println("ERROR: Unable to acquire log service. Application will proceed, but logging will be disabled.");
      }
    } catch (IOException e) {
      e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.eclipse.osgi.framework.log.FrameworkLog

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.