1 package org.simantics.scl.reflection.internal;
3 import org.eclipse.core.runtime.ILog;
4 import org.eclipse.core.runtime.Platform;
5 import org.eclipse.core.runtime.Status;
6 import org.osgi.framework.Bundle;
7 import org.osgi.framework.BundleActivator;
8 import org.osgi.framework.BundleContext;
9 import org.slf4j.Logger;
10 import org.slf4j.LoggerFactory;
12 public class Activator implements BundleActivator {
14 private static final Logger LOGGER = LoggerFactory.getLogger(Activator.class);
15 private BundleContext context;
17 private static Activator instance;
20 public void start(BundleContext context) throws Exception {
21 this.context = context;
26 public void stop(BundleContext context) throws Exception {
31 public BundleContext getContext() {
35 public static Activator getInstance() {
39 public static void logError(String description, Exception e) {
40 LOGGER.error(description);
43 Bundle bundle = getInstance().getContext().getBundle();
44 ILog log = Platform.getLog(bundle);
45 log.log(new Status(Status.ERROR, bundle.getSymbolicName(), description, e));
48 public static void logError(String description) {
49 logError(description, null);