Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/codan
diff options
context:
space:
mode:
authorAlena Laskavaia2009-05-09 01:36:37 +0000
committerAlena Laskavaia2009-05-09 01:36:37 +0000
commit1f13ed7bcce934c62674e2db49d9e6e5bc07b2d3 (patch)
tree3e2de1428f746657816302b9c2518f966e2faefe /codan
parentdf4afdbaffc7e92302a39c97941c347726d87e91 (diff)
downloadorg.eclipse.cdt-1f13ed7bcce934c62674e2db49d9e6e5bc07b2d3.tar.gz
org.eclipse.cdt-1f13ed7bcce934c62674e2db49d9e6e5bc07b2d3.tar.xz
org.eclipse.cdt-1f13ed7bcce934c62674e2db49d9e6e5bc07b2d3.zip
added logging
Diffstat (limited to 'codan')
-rw-r--r--codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/Activator.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/Activator.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/Activator.java
index bc60feb72fd..2915e7d0d80 100644
--- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/Activator.java
+++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/Activator.java
@@ -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);
+ }
}

Back to the top