-package org.simantics.scl.reflection.internal;\r
-\r
-import org.eclipse.core.runtime.ILog;\r
-import org.eclipse.core.runtime.Platform;\r
-import org.eclipse.core.runtime.Status;\r
-import org.osgi.framework.Bundle;\r
-import org.osgi.framework.BundleActivator;\r
-import org.osgi.framework.BundleContext;\r
-\r
-public class Activator implements BundleActivator {\r
-\r
- private BundleContext context; \r
- \r
- private static Activator instance;\r
- \r
- @Override\r
- public void start(BundleContext context) throws Exception {\r
- this.context = context;\r
- instance = this;\r
- }\r
-\r
- @Override\r
- public void stop(BundleContext context) throws Exception {\r
- instance = null;\r
- this.context = null;\r
- }\r
- \r
- public BundleContext getContext() {\r
- return context;\r
- }\r
- \r
- public static Activator getInstance() {\r
- return instance;\r
- }\r
- \r
- public static void logError(String description, Exception e) {\r
- System.err.println(description);\r
- if(e != null)\r
- e.printStackTrace();\r
- Bundle bundle = getInstance().getContext().getBundle();\r
- ILog log = Platform.getLog(bundle);\r
- log.log(new Status(Status.ERROR, bundle.getSymbolicName(), description, e));\r
- }\r
- \r
- public static void logError(String description) {\r
- logError(description, null);\r
- }\r
-\r
-}\r
+package org.simantics.scl.reflection.internal;
+
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class Activator implements BundleActivator {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(Activator.class);
+ private BundleContext context;
+
+ private static Activator instance;
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ this.context = context;
+ instance = this;
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ instance = null;
+ this.context = null;
+ }
+
+ public BundleContext getContext() {
+ return context;
+ }
+
+ public static Activator getInstance() {
+ return instance;
+ }
+
+ public static void logError(String description, Exception e) {
+ LOGGER.error(description);
+ if(e != null)
+ e.printStackTrace();
+ Bundle bundle = getInstance().getContext().getBundle();
+ ILog log = Platform.getLog(bundle);
+ log.log(new Status(Status.ERROR, bundle.getSymbolicName(), description, e));
+ }
+
+ public static void logError(String description) {
+ logError(description, null);
+ }
+
+}