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