1 19 20 package org.netbeans.modules.schema2beans; 21 22 import java.io.*; 23 24 25 28 29 public class TraceLogger extends Object { 30 public static int MAXGROUP = 255; 31 32 public static int DEBUG = 1; 33 34 public static int SVC_DD = 1; 35 36 public static PrintStream output = System.out; 37 38 static DDLogFlags flags = new DDLogFlags(); 39 40 static public void put(int type, int service, int group, int level, 41 int msg) { 42 put(type, service, group, level, msg, null); 43 } 44 45 static public void put(int type, int service, int group, int level, 46 int msg, Object obj) { 47 48 String strService = "DD "; String strGroup = flags.dbgNames[group-1]; 50 String strMsg = ((String [])(flags.actionSets[group-1]))[msg-1]; 51 52 if (obj != null) { 53 System.out.println( strService + " " + strGroup + " " + strMsg + "\t" + obj.toString()); } 56 else { 57 System.out.println( strService + " " + strGroup + " " + strMsg); } 59 } 60 61 public static void error(String str) { 62 output.println(str); 63 } 64 65 public static void error(Throwable e) { 66 output.println("*** ERROR - got the following exception ---"); output.println(e.getMessage()); 68 e.printStackTrace(output); 69 output.println("*** ERROR ---------------------------------"); } 71 } 72 73 | Popular Tags |