~ubuntu-branches/ubuntu/raring/libjboss-remoting-java/raring

« back to all changes in this revision

Viewing changes to src/main/org/jboss/remoting/samples/chat/utility/Debug.java

  • Committer: Package Import Robot
  • Author(s): Torsten Werner
  • Date: 2011-09-09 14:01:03 UTC
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: package-import@ubuntu.com-20110909140103-o8ucrolqt5g25k57
Tags: upstream-2.5.3.SP1
ImportĀ upstreamĀ versionĀ 2.5.3.SP1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.jboss.remoting.samples.chat.utility;
 
2
 
 
3
/**
 
4
 * <p>Title: Chat4</p>
 
5
 * <p>Description: </p>
 
6
 * <p>Copyright: Copyright (c) 2003</p>
 
7
 * <p>Company: </p>
 
8
 * @author not attributable
 
9
 * @version 1.0
 
10
 */
 
11
 
 
12
 
 
13
public class Debug {
 
14
  private static boolean on = false;
 
15
 
 
16
  public static void turnOn()
 
17
  {
 
18
    on = true;
 
19
    System.out.println("Debug: chat debugging turned on");
 
20
  }
 
21
 
 
22
  public static void turnOff()
 
23
  {
 
24
    on = false;
 
25
    System.out.println("Debug: chat debugging turned on");
 
26
    }
 
27
 
 
28
  public static boolean isOn()
 
29
  {
 
30
    return on;
 
31
  }
 
32
 
 
33
  public static void println(String str) {
 
34
    if (on)
 
35
      if (str != null)
 
36
        System.out.println(str);
 
37
      else
 
38
        System.out.println("null");
 
39
  }
 
40
}