Easy logging for RCP applications

Veröffentlicht von

A small class for easy logging in RCP applications by using the Activators logging functions. This class mainly wraps the need of creating an IStatus object each time we want to log something.

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;

public class LoggerUtil {
    public static void info(String message){
        IStatus status = new Status(IStatus.INFO,Activator.PLUGIN_ID, message);
        Activator.getDefault().getLog().log(status);
    }

    public static void error(String message){
        IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, message);
        Activator.getDefault().getLog().log(status);
    }

    public static void warning(String message){
        IStatus status = new Status(IStatus.WARNING,.PLUGIN_ID, message);
        Activator.getDefault().getLog().log(status);
    }
}

Kommentar hinterlassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.