Changeset 633 for trunk/quest-ui-core/src/main/java
- Timestamp:
- 08/27/12 15:17:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-ui-core/src/main/java/de/ugoe/cs/quest/log4j/Log4JLogger.java
r579 r633 1 1 package de.ugoe.cs.quest.log4j; 2 3 import java.util.logging.Level; 2 4 3 5 import org.apache.log4j.Logger; … … 75 77 */ 76 78 @Override 77 public void traceMsg(String traceMessage ) {78 logger.trace(traceMessage);79 public void traceMsg(String traceMessage, Level level) { 80 logger.log(convertToLog4JLevel(level), traceMessage); 79 81 } 80 82 … … 90 92 logger.error(errMessage); 91 93 } 94 95 /** 96 * <p> 97 * Converts the log level described by {@link Level} into a {@link org.apache.log4j.Level}. 98 * </p> 99 * 100 * @param level java.util.logger.Level severity 101 * @return org.apache.log4j.Level severity 102 */ 103 private org.apache.log4j.Level convertToLog4JLevel(Level level) { 104 if(level==Level.OFF) { 105 return org.apache.log4j.Level.OFF; 106 } 107 if(level==Level.SEVERE) { 108 return org.apache.log4j.Level.FATAL; 109 } 110 if(level==Level.WARNING) { 111 return org.apache.log4j.Level.WARN; 112 } 113 if(level==Level.INFO || level==Level.CONFIG) { 114 return org.apache.log4j.Level.INFO; 115 } 116 // remaining levels: FINE, FINER, FINEST, ALL 117 return org.apache.log4j.Level.ALL; 118 } 92 119 }
Note: See TracChangeset
for help on using the changeset viewer.