1 42 43 package org.jfree.base.log; 44 45 import org.jfree.base.BaseBoot; 46 import org.jfree.util.PrintStreamLogTarget; 47 48 54 public class LogConfiguration { 55 56 public static final String DISABLE_LOGGING_DEFAULT = "false"; 57 58 59 public static final String LOGLEVEL = "org.jfree.base.LogLevel"; 60 61 62 public static final String LOGLEVEL_DEFAULT = "Info"; 63 64 65 public static final String LOGTARGET = "org.jfree.base.LogTarget"; 66 67 68 public static final String LOGTARGET_DEFAULT = 69 PrintStreamLogTarget.class.getName(); 70 71 72 public static final String DISABLE_LOGGING = "org.jfree.base.NoDefaultDebug"; 73 74 77 private LogConfiguration() { 78 } 80 81 86 public static String getLogTarget() 87 { 88 return BaseBoot.getInstance().getGlobalConfig().getConfigProperty 89 (LOGTARGET, LOGTARGET_DEFAULT); 90 } 91 92 97 public static void setLogTarget(final String logTarget) 98 { 99 BaseBoot.getConfiguration().setConfigProperty (LOGTARGET, logTarget); 100 } 101 102 107 public static String getLogLevel() 108 { 109 return BaseBoot.getInstance().getGlobalConfig().getConfigProperty 110 (LOGLEVEL, LOGLEVEL_DEFAULT); 111 } 112 113 136 public static void setLogLevel(final String level) 137 { 138 BaseBoot.getConfiguration().setConfigProperty(LOGLEVEL, level); 139 } 140 141 146 public static boolean isDisableLogging() 147 { 148 return BaseBoot.getInstance().getGlobalConfig().getConfigProperty 149 (DISABLE_LOGGING, DISABLE_LOGGING_DEFAULT).equalsIgnoreCase("true"); 150 } 151 152 161 public static void setDisableLogging(final boolean disableLogging) 162 { 163 BaseBoot.getConfiguration().setConfigProperty 164 (DISABLE_LOGGING, String.valueOf(disableLogging)); 165 } 166 167 168 } 169 | Popular Tags |