diff --git a/rse/plugins/org.eclipse.rse.logging/src/org/eclipse/rse/logging/Logger.java b/rse/plugins/org.eclipse.rse.logging/src/org/eclipse/rse/logging/Logger.java index 3524c3d9799..93512b9334a 100644 --- a/rse/plugins/org.eclipse.rse.logging/src/org/eclipse/rse/logging/Logger.java +++ b/rse/plugins/org.eclipse.rse.logging/src/org/eclipse/rse/logging/Logger.java @@ -71,6 +71,15 @@ import org.eclipse.core.runtime.Preferences.PropertyChangeEvent; * */ public class Logger implements IPropertyChangeListener { + + /** + * Constant can be used to surround debugging code. Optimizing + * compilers have the possibility of removing the code from + * a production copy. + * + * Should be set false normally. Only set to true when testing. + */ + public static final boolean DEBUG = false; private ILog systemsPluginLog = null; private RemoteSystemLogListener logListener = null; @@ -121,7 +130,7 @@ public class Logger implements IPropertyChangeListener { * need to be localized to proper local.
*/ public synchronized void logDebugMessage(String className, String message) { - if (debug_level >= IRemoteSystemsLogging.LOG_DEBUG) { + if (Logger.DEBUG && debug_level >= IRemoteSystemsLogging.LOG_DEBUG) { MultiStatus debugStatus = new MultiStatus(pluginId, IStatus.OK, className, null); Status infoStatus = new Status(IStatus.OK, pluginId, IStatus.OK, message, null); debugStatus.add(infoStatus); diff --git a/rse/plugins/org.eclipse.rse.logging/src/org/eclipse/rse/logging/ui/LoggingPreferencePage.java b/rse/plugins/org.eclipse.rse.logging/src/org/eclipse/rse/logging/ui/LoggingPreferencePage.java index 52fb38c93d0..1b76e14d02b 100644 --- a/rse/plugins/org.eclipse.rse.logging/src/org/eclipse/rse/logging/ui/LoggingPreferencePage.java +++ b/rse/plugins/org.eclipse.rse.logging/src/org/eclipse/rse/logging/ui/LoggingPreferencePage.java @@ -25,6 +25,7 @@ import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferencePage; import org.eclipse.jface.preference.PreferenceStore; import org.eclipse.rse.logging.IRemoteSystemsLogging; +import org.eclipse.rse.logging.Logger; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; @@ -94,8 +95,10 @@ public abstract class LoggingPreferencePage extends PreferencePage implements IW radioButton1 = createRadioButton(composite1_radioButton, LabelUtil.assignMnemonic(text, used)); text = LoggingPreferenceLabels.LOGGING_PREFERENCE_PAGE_INFO_DEBUG; radioButton2 = createRadioButton(composite1_radioButton, LabelUtil.assignMnemonic(text, used)); - text = LoggingPreferenceLabels.LOGGING_PREFERENCE_PAGE_FULL_DEBUG; - radioButton3 = createRadioButton(composite1_radioButton, LabelUtil.assignMnemonic(text, used)); + if (Logger.DEBUG) { + text = LoggingPreferenceLabels.LOGGING_PREFERENCE_PAGE_FULL_DEBUG; + radioButton3 = createRadioButton(composite1_radioButton, LabelUtil.assignMnemonic(text, used)); + } initializeValues(); PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, "org.eclipse.rse.logging.rsel0000"); return new Composite(parent, SWT.NULL);