1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-19 23:15:24 +02:00

added logging

This commit is contained in:
Alena Laskavaia 2009-05-09 01:36:37 +00:00
parent df4afdbaff
commit 1f13ed7bcc

View file

@ -1,6 +1,8 @@
package org.eclipse.cdt.codan.checkers;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.osgi.framework.BundleContext;
/**
@ -50,4 +52,23 @@ public class Activator extends Plugin {
public static Activator getDefault() {
return plugin;
}
/**
* @param e
*/
public static void log(Throwable e) {
getDefault().getLog().log(getStatus(e));
}
public static void log(String message) {
getDefault().getLog().log(new Status(Status.ERROR, PLUGIN_ID, message));
}
/**
* @param e
* @return
*/
public static IStatus getStatus(Throwable e) {
return new Status(Status.ERROR, PLUGIN_ID, e.getLocalizedMessage(), e);
}
}