Workaround for feature request #1154254 (sticky browser URL) that solves bug #1827766...
[phpeclipse.git] / net.sourceforge.phpeclipse.webbrowser / src / net / sourceforge / phpeclipse / webbrowser / internal / Trace.java
1 /**
2  * Copyright (c) 2003 IBM Corporation and others.
3  * All rights reserved. � This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  �*
8  * Contributors:
9  *    IBM - Initial API and implementation
10  */
11 package net.sourceforge.phpeclipse.webbrowser.internal;
12
13 /**
14  * Helper class to route trace output.
15  */
16 public class Trace {
17         public static int CONFIG = 0;
18
19         public static int WARNING = 2;
20
21         public static int SEVERE = 3;
22
23         public static int FINER = 4;
24
25         public static int FINEST = 5;
26
27         /**
28          * Trace constructor comment.
29          */
30         private Trace() {
31                 super();
32         }
33
34         /**
35          * Trace the given text.
36          * 
37          * @param s
38          *            java.lang.String
39          */
40         public static void trace(int level, String s) {
41                 Trace.trace(level, s, null);
42         }
43
44         /**
45          * Trace the given message and exception.
46          * 
47          * @param s
48          *            java.lang.String
49          * @param t
50          *            java.lang.Throwable
51          */
52         public static void trace(int level, String s, Throwable t) {
53                 if (!WebBrowserUIPlugin.getInstance().isDebugging())
54                         return;
55
56                 System.out.println(s);
57                 if (t != null)
58                         t.printStackTrace();
59         }
60 }