KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > browser > Trace


1 /*******************************************************************************
2  * Copyright (c) 2003, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - Initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal.browser;
12 /**
13  * Helper class to route trace output.
14  */

15 public class Trace {
16     public static int CONFIG = 0;
17     public static int WARNING = 2;
18     public static int SEVERE = 3;
19     public static int FINER = 4;
20     public static int FINEST = 5;
21
22     /**
23      * Trace constructor comment.
24      */

25     private Trace() {
26         super();
27     }
28
29     /**
30      * Trace the given text.
31      *
32      * @param s java.lang.String
33      */

34     public static void trace(int level, String JavaDoc s) {
35         Trace.trace(level, s, null);
36     }
37
38     /**
39      * Trace the given message and exception.
40      *
41      * @param s java.lang.String
42      * @param t java.lang.Throwable
43      */

44     public static void trace(int level, String JavaDoc s, Throwable JavaDoc t) {
45         if (!WebBrowserUIPlugin.getInstance().isDebugging())
46             return;
47
48         System.out.println(s);
49         if (t != null)
50             t.printStackTrace();
51     }
52 }
Popular Tags