01: /**
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */package com.tc.util;
05:
06: /**
07: * This a temporary class to hold a debug flag and should be removed after the CyclicBarrier bug is found. TODO: Remove
08: * after the bug is found.
09: */
10: public class DebugUtil {
11: public static boolean DEBUG = false;
12:
13: private static String nodeId = String.valueOf(System
14: .identityHashCode(DebugUtil.class));
15:
16: public static void setNodeId(String v) {
17: nodeId = v
18: + ".["
19: + String.valueOf(System
20: .identityHashCode(DebugUtil.class)) + "]";
21: }
22:
23: public static String nodeId() {
24: return nodeId;
25: }
26:
27: public static void trace(String msg) {
28: final String m = "\n\n@@@@ " + nodeId() + " -> " + msg + "\n\n";
29: System.err.println(m);
30: }
31:
32: public static void trace(String method, String msg) {
33: final String m = "\n\n@@@@ " + nodeId() + " -> " + method
34: + " -> " + msg + "\n\n";
35: System.err.println(m);
36: }
37: }
|