mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-19 23:15:24 +02:00
added logging
This commit is contained in:
parent
df4afdbaff
commit
1f13ed7bcc
1 changed files with 21 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue