--- /dev/null
+package org.simantics.structural.synchronization.internal;\r
+\r
+import org.eclipse.core.runtime.ILog;\r
+import org.eclipse.core.runtime.IStatus;\r
+import org.eclipse.core.runtime.Platform;\r
+import org.eclipse.core.runtime.Status;\r
+import org.osgi.framework.Bundle;\r
+\r
+/**\r
+ * @author Tuukka Lehtonen\r
+ */\r
+public final class Policy {\r
+\r
+ public static final String PLUGIN_ID = "org.simantics.structural.synchronization";\r
+\r
+ //public static boolean TRACE_EVENTS = false;\r
+\r
+ static {\r
+ //String sTrue = Boolean.TRUE.toString();\r
+ //DEBUG_... = sTrue.equalsIgnoreCase(Platform.getDebugOption(PLUGIN_ID + "/debug/synchronization/...")); //$NON-NLS-1$\r
+ }\r
+\r
+ public static ILog getLog() {\r
+ Bundle b = Platform.getBundle(PLUGIN_ID);\r
+ if (b != null)\r
+ return Platform.getLog(b);\r
+ throw new IllegalStateException("bundle " + PLUGIN_ID + " not resolved");\r
+ }\r
+\r
+ public static void log(IStatus status) {\r
+ getLog().log(status);\r
+ }\r
+\r
+ public static void log(int severity, String message, Throwable t) {\r
+ getLog().log(new Status(severity, PLUGIN_ID, message, t));\r
+ }\r
+\r
+ public static void logError(String message, Throwable t) {\r
+ log(IStatus.ERROR, message, t);\r
+ }\r
+\r
+ public static void logError(Throwable t) {\r
+ logError(t.getMessage(), t);\r
+ }\r
+\r
+ public static void logWarning(String message, Throwable t) {\r
+ log(IStatus.WARNING, message, t);\r
+ }\r
+\r
+ public static void logWarning(Throwable t) {\r
+ logWarning(t.getMessage(), t);\r
+ }\r
+\r
+}
\ No newline at end of file