- public final static int TRACE = 10;
-
- public final static int DEBUG = 20;
-
- public final static int INFO = 30;
-
- public final static int WARN = 40;
-
- public final static int ERROR = 50;
-
- public static boolean println(int level, String message)
- {
- if (Cache.log == null)
- {
- if (level >= WARN)
- System.err.println(message);
- else if (level >= INFO)
- System.out.println(message);
- // not printing debug or trace messages
- return false;
- }
- if (level >= ERROR)
- {
- Cache.log.error(message);
- }
- else if (level >= WARN)
- {
- Cache.log.warn(message);
- }
- else if (level >= INFO)
- {
- Cache.log.info(message);
- }
- else if (level >= DEBUG)
- {
- Cache.log.debug(message);
- }
- else
- {
- Cache.log.trace(message);
- }
- return true;
- }
-
- public static void trace(String message)
- {
- println(TRACE, message);
- }
-
- public static void debug(String message)
- {
- println(DEBUG, message);
- }
-
- public static void info(String message)
- {
- println(INFO, message);
- }
-
- public static void warn(String message)
- {
- println(WARN, message);
- }
-
- public static void error(String message)
- {
- println(ERROR, message);
- }
-