diff options
author | ndai | 2011-08-12 18:55:11 +0000 |
---|---|---|
committer | ndai | 2011-08-12 18:55:11 +0000 |
commit | 453c7c911dbd2af45e35087b9b2a0b30d394b720 (patch) | |
tree | e1faf954a2e089cccba6bb0cf77051504ebf180d /plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/Trace.java | |
parent | 2877e1e21e1ccc773589768bb2dc0542ae3497b4 (diff) | |
download | webtools.servertools-20110812_1455.tar.gz webtools.servertools-20110812_1455.tar.xz webtools.servertools-20110812_1455.zip |
This commit was manufactured by cvs2svn to create tag 'v20110812_1455'.v20110812_1455
Diffstat (limited to 'plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/Trace.java')
-rw-r--r-- | plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/Trace.java | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/Trace.java b/plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/Trace.java deleted file mode 100644 index 9ea245b42..000000000 --- a/plugins/org.eclipse.jst.server.ui/src/org/eclipse/jst/server/ui/internal/Trace.java +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2011 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.server.ui.internal; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.osgi.service.debug.DebugOptions; -import org.eclipse.osgi.service.debug.DebugOptionsListener; - -/** - * Helper class to route trace output. - */ -public class Trace implements DebugOptionsListener { - - // tracing enablement flags - public static boolean CONFIG = false; - public static boolean WARNING = false; - public static boolean SEVERE = false; - public static boolean FINEST = false; - - // tracing levels. One most exist for each debug option - public final static String STRING_CONFIG = "/config"; //$NON-NLS-1$ - public final static String STRING_FINEST = "/finest"; //$NON-NLS-1$ - public final static String STRING_WARNING = "/warning"; //$NON-NLS-1$ - public final static String STRING_SEVERE = "/severe"; //$NON-NLS-1$ - - /** - * Trace constructor. This should never be explicitly called by clients and is used to register this class with the - * {@link DebugOptions} service. - */ - public Trace() { - super(); - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.osgi.service.debug.DebugOptionsListener#optionsChanged(org.eclipse.osgi.service.debug.DebugOptions) - */ - public void optionsChanged(DebugOptions options) { - Trace.CONFIG = options.getBooleanOption(JavaServerUIPlugin.PLUGIN_ID + Trace.STRING_CONFIG, false); - Trace.WARNING = options.getBooleanOption(JavaServerUIPlugin.PLUGIN_ID + Trace.STRING_WARNING, false); - Trace.SEVERE = options.getBooleanOption(JavaServerUIPlugin.PLUGIN_ID + Trace.STRING_SEVERE, false); - Trace.FINEST = options.getBooleanOption(JavaServerUIPlugin.PLUGIN_ID + Trace.STRING_FINEST, false); - } - - /** - * Trace the given message. - * - * @param level - * The tracing level. - * @param s - * The message to trace - */ - public static void trace(final String level, final String s) { - Trace.trace(level, s, null); - } - - /** - * Trace the given message and exception. - * - * @param level - * The tracing level. - * @param s - * The message to trace - * @param t - * A {@link Throwable} to trace - */ - public static void trace(final String level, final String s, final Throwable t) { - - if (Trace.STRING_SEVERE.equals(level)) { - JavaServerUIPlugin.getInstance().getLog() - .log(new Status(IStatus.ERROR, JavaServerUIPlugin.PLUGIN_ID, s, t)); - } - if (JavaServerUIPlugin.getInstance().isDebugging()) { - System.out.println(JavaServerUIPlugin.PLUGIN_ID + " " + level + " " + s); - if (t != null) { - t.printStackTrace(); - } - } - } -}
\ No newline at end of file |