Author: shawkins
Date: 2009-12-22 12:45:11 -0500 (Tue, 22 Dec 2009)
New Revision: 1697
Modified:
trunk/common-internal/src/main/java/com/metamatrix/common/log/LogConfigurationImpl.java
trunk/common-internal/src/main/java/com/metamatrix/common/log/LogManager.java
Log:
adding a default level so that unit tests can use the default java logger
Modified:
trunk/common-internal/src/main/java/com/metamatrix/common/log/LogConfigurationImpl.java
===================================================================
---
trunk/common-internal/src/main/java/com/metamatrix/common/log/LogConfigurationImpl.java 2009-12-22
16:58:39 UTC (rev 1696)
+++
trunk/common-internal/src/main/java/com/metamatrix/common/log/LogConfigurationImpl.java 2009-12-22
17:45:11 UTC (rev 1697)
@@ -27,15 +27,15 @@
import java.util.Map;
import java.util.Set;
-import com.metamatrix.core.log.MessageLevel;
-
public class LogConfigurationImpl implements LogConfiguration, Serializable {
private static final long serialVersionUID = 4626429149431532292L;
Map<String, Integer> contextMap = null;
+ private int defaultLevel;
- public LogConfigurationImpl() {
+ public LogConfigurationImpl(int defaultLevel) {
+ this.defaultLevel = defaultLevel;
this.contextMap = new HashMap<String, Integer>();
}
@@ -58,7 +58,7 @@
if (level != null) {
return level;
}
- return MessageLevel.NONE;
+ return defaultLevel;
}
private String fixContext(String context) {
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/log/LogManager.java
===================================================================
---
trunk/common-internal/src/main/java/com/metamatrix/common/log/LogManager.java 2009-12-22
16:58:39 UTC (rev 1696)
+++
trunk/common-internal/src/main/java/com/metamatrix/common/log/LogManager.java 2009-12-22
17:45:11 UTC (rev 1697)
@@ -88,7 +88,7 @@
public final class LogManager {
@Inject
- static LogConfiguration configuration = new LogConfigurationImpl(); // either
injected or manually set using the set methods
+ static LogConfiguration configuration = new
LogConfigurationImpl(MessageLevel.DETAIL); // either injected or manually set using the
set methods
@Inject
static LogListener logListener = new JavaLogWriter(); // either injected or manually
set using the set methods