Search in sources :

Example 1 with ILog

use of org.eclipse.core.runtime.ILog in project dbeaver by serge-rider.

the class Log method writeExceptionStatus.

private static void writeExceptionStatus(int severity, Object message, Throwable t) {
    debugMessage(message, t, System.err);
    ModelActivator activator = ModelActivator.getInstance();
    if (activator != null) {
        // Activator may be null in some unclear circumstances (like shutdown is in progress)
        ILog log = activator.getLog();
        if (log != null) {
            if (t == null) {
                log.log(new Status(severity, corePluginID, message == null ? null : message.toString()));
            } else {
                if (message == null) {
                    log.log(GeneralUtils.makeExceptionStatus(severity, t));
                } else {
                    log.log(GeneralUtils.makeExceptionStatus(severity, message.toString(), t));
                }
            }
        }
    }
}
Also used : Status(org.eclipse.core.runtime.Status) ILog(org.eclipse.core.runtime.ILog) ModelActivator(org.jkiss.dbeaver.bundle.ModelActivator)

Example 2 with ILog

use of org.eclipse.core.runtime.ILog in project bndtools by bndtools.

the class Activator method log.

public static void log(String msg, int msgType) {
    ILog log = getDefault().getLog();
    //$NON-NLS-1$
    Status status = new Status(msgType, getDefault().getBundle().getSymbolicName(), msgType, msg + "\n", null);
    log.log(status);
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) ILog(org.eclipse.core.runtime.ILog)

Aggregations

ILog (org.eclipse.core.runtime.ILog)2 Status (org.eclipse.core.runtime.Status)2 IStatus (org.eclipse.core.runtime.IStatus)1 ModelActivator (org.jkiss.dbeaver.bundle.ModelActivator)1