1 package net.sf.invicta; 2 3 7 public class Logger { 8 private static boolean isDebug; 10 11 static { 12 String propertyValue = System.getProperty(InvictaConstants.DEBUG_SYSTEM_PROPERTY); 13 if ((propertyValue != null) && 14 (Boolean.valueOf(propertyValue).booleanValue())) { 15 isDebug = true; 16 } else { 17 isDebug=false; 18 } 19 } 20 21 22 25 public static boolean isDebugMode() { 26 return isDebug; 27 } 28 29 33 public static void debug(String message) { 34 if (isDebug) 35 System.out.println("Debug: " + message); 36 } 37 38 42 public static void info(String message) { 43 System.out.println(message); 44 } 45 46 50 public static void warn(String message) { 51 System.out.println("Warning: " + message); 52 } 53 54 58 public static void error(String message) { 59 System.out.println("Error: " + message); 60 } 61 } 62 | Popular Tags |