1 package org.simantics.structural.synchronization.internal;
3 import org.eclipse.core.runtime.ILog;
4 import org.eclipse.core.runtime.IStatus;
5 import org.eclipse.core.runtime.Platform;
6 import org.eclipse.core.runtime.Status;
7 import org.osgi.framework.Bundle;
10 * @author Tuukka Lehtonen
12 public final class Policy {
14 public static final String PLUGIN_ID = "org.simantics.structural.synchronization";
16 //public static boolean TRACE_EVENTS = false;
19 //String sTrue = Boolean.TRUE.toString();
20 //DEBUG_... = sTrue.equalsIgnoreCase(Platform.getDebugOption(PLUGIN_ID + "/debug/synchronization/...")); //$NON-NLS-1$
23 public static ILog getLog() {
24 Bundle b = Platform.getBundle(PLUGIN_ID);
26 return Platform.getLog(b);
27 throw new IllegalStateException("bundle " + PLUGIN_ID + " not resolved");
30 public static void log(IStatus status) {
34 public static void log(int severity, String message, Throwable t) {
35 getLog().log(new Status(severity, PLUGIN_ID, message, t));
38 public static void logError(String message, Throwable t) {
39 log(IStatus.ERROR, message, t);
42 public static void logError(Throwable t) {
43 logError(t.getMessage(), t);
46 public static void logWarning(String message, Throwable t) {
47 log(IStatus.WARNING, message, t);
50 public static void logWarning(Throwable t) {
51 logWarning(t.getMessage(), t);