Package org.nodeclipse.debug.util

Source Code of org.nodeclipse.debug.util.LogUtil

package org.nodeclipse.debug.util;

import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.nodeclipse.debug.Activator;

public class LogUtil {

    public static void info(String message) {
        log(IStatus.INFO, IStatus.OK, message, null);
    }

    public static void error(Throwable exception) {
        error("Unexpected Exception", exception);
    }

    public static void error(String message) {
        error(message, null);
    }

    public static void error(String message, Throwable exception) {
        log(IStatus.ERROR, IStatus.ERROR, message, exception);
    }

    public static void log(int severity, int code, String message, Throwable exception) {
        log(createStatus(severity, code, message, exception));
    }

    public static IStatus createStatus(int severity, int code, String message, Throwable exception) {
        return new Status(severity, Activator.PLUGIN_ID, code, message, exception);
    }

    public static void log(IStatus status) {
        ILog log = Activator.getDefault().getLog();
        log.log(status);
    }
}
TOP

Related Classes of org.nodeclipse.debug.util.LogUtil

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.