blob: 60f6cc30d0d3c152c02931961c7fdda693ea916b [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2003, 2005 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.wst.internet.monitor.core.internal;
/**
* Helper class to route trace output.
*/
public class Trace {
public static byte CONFIG = 0;
public static byte WARNING = 1;
public static byte SEVERE = 2;
public static byte FINEST = 3;
public static byte PARSING = 4;
/**
* Trace constructor comment.
*/
private Trace() {
super();
}
/**
* Trace the given text.
*
* @param s java.lang.String
*/
public static void trace(byte level, String s) {
trace(level, s, null);
}
/**
* Trace the given message and exception.
*
* @param s java.lang.String
* @param t java.lang.Throwable
*/
public static void trace(byte level, String s, Throwable t) {
if (!MonitorPlugin.getInstance().isDebugging())
return;
System.out.println(System.currentTimeMillis() + " " + s);
if (t != null)
t.printStackTrace();
}
}