X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.structural.synchronization.client%2Fsrc%2Forg%2Fsimantics%2Fstructural%2Fsynchronization%2Finternal%2FPolicy.java;fp=bundles%2Forg.simantics.structural.synchronization.client%2Fsrc%2Forg%2Fsimantics%2Fstructural%2Fsynchronization%2Finternal%2FPolicy.java;h=ad9f6468c2309b2b9b422d95deaa424ef67e1dad;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hp=93aa38758960ad2991e1bb5f70492375ce1ccb94;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/internal/Policy.java b/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/internal/Policy.java index 93aa38758..ad9f6468c 100644 --- a/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/internal/Policy.java +++ b/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/internal/Policy.java @@ -1,54 +1,54 @@ -package org.simantics.structural.synchronization.internal; - -import org.eclipse.core.runtime.ILog; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; -import org.osgi.framework.Bundle; - -/** - * @author Tuukka Lehtonen - */ -public final class Policy { - - public static final String PLUGIN_ID = "org.simantics.structural.synchronization"; - - //public static boolean TRACE_EVENTS = false; - - static { - //String sTrue = Boolean.TRUE.toString(); - //DEBUG_... = sTrue.equalsIgnoreCase(Platform.getDebugOption(PLUGIN_ID + "/debug/synchronization/...")); //$NON-NLS-1$ - } - - public static ILog getLog() { - Bundle b = Platform.getBundle(PLUGIN_ID); - if (b != null) - return Platform.getLog(b); - throw new IllegalStateException("bundle " + PLUGIN_ID + " not resolved"); - } - - public static void log(IStatus status) { - getLog().log(status); - } - - public static void log(int severity, String message, Throwable t) { - getLog().log(new Status(severity, PLUGIN_ID, message, t)); - } - - public static void logError(String message, Throwable t) { - log(IStatus.ERROR, message, t); - } - - public static void logError(Throwable t) { - logError(t.getMessage(), t); - } - - public static void logWarning(String message, Throwable t) { - log(IStatus.WARNING, message, t); - } - - public static void logWarning(Throwable t) { - logWarning(t.getMessage(), t); - } - +package org.simantics.structural.synchronization.internal; + +import org.eclipse.core.runtime.ILog; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.osgi.framework.Bundle; + +/** + * @author Tuukka Lehtonen + */ +public final class Policy { + + public static final String PLUGIN_ID = "org.simantics.structural.synchronization"; + + //public static boolean TRACE_EVENTS = false; + + static { + //String sTrue = Boolean.TRUE.toString(); + //DEBUG_... = sTrue.equalsIgnoreCase(Platform.getDebugOption(PLUGIN_ID + "/debug/synchronization/...")); //$NON-NLS-1$ + } + + public static ILog getLog() { + Bundle b = Platform.getBundle(PLUGIN_ID); + if (b != null) + return Platform.getLog(b); + throw new IllegalStateException("bundle " + PLUGIN_ID + " not resolved"); + } + + public static void log(IStatus status) { + getLog().log(status); + } + + public static void log(int severity, String message, Throwable t) { + getLog().log(new Status(severity, PLUGIN_ID, message, t)); + } + + public static void logError(String message, Throwable t) { + log(IStatus.ERROR, message, t); + } + + public static void logError(Throwable t) { + logError(t.getMessage(), t); + } + + public static void logWarning(String message, Throwable t) { + log(IStatus.WARNING, message, t); + } + + public static void logWarning(Throwable t) { + logWarning(t.getMessage(), t); + } + } \ No newline at end of file