1 24 package com.scalagent.kjoram; 25 26 29 public class JoramTracing { 30 public static int ERROR = 1; 31 public static int WARN = 2; 32 public static int INFO = 3; 33 public static int DEBUG = 4; 34 35 public static int traceLevel = 1; 36 37 public static boolean dbgClient = false; 38 public static boolean dbgAdmin = false; 39 public static boolean dbg = false; 40 41 static { 42 String l = System.getProperty("traceLevel"); 43 if (l != null && l != "") { 44 traceLevel = Integer.parseInt(l); 45 } 46 if (System.getProperty("dbgClient") != null) 47 dbgClient = true; 48 if (System.getProperty("dbgAdmin") != null) 49 dbgAdmin = true; 50 if (System.getProperty("dbg") != null) 51 dbg = true; 52 } 53 54 public static void log(int level, String trace) { 55 if (level <= traceLevel) 56 System.out.println(trace); 57 } 58 59 public static void log(int level, Exception exc) { 60 log(level,exc.toString()); 61 } 62 } 63 | Popular Tags |