fixed DEBUG to be set when loglevel is set to DEBUG.

This commit is contained in:
Niclas Finne 2013-03-08 17:34:10 +01:00
parent 70c880423a
commit e569e6c3c3
2 changed files with 4 additions and 10 deletions

View File

@ -69,9 +69,6 @@ public abstract class Chip implements Loggable, EventSource {
public Chip(String id, MSP430Core cpu) {
this(id, id, cpu);
if (cpu != null) {
logger = cpu.getLogger();
}
}
public Chip(String id, String name, MSP430Core cpu) {

View File

@ -36,9 +36,6 @@
*/
package se.sics.mspsim.core;
import java.io.PrintStream;
import se.sics.mspsim.core.EmulationLogger.WarningType;
public abstract class IOUnit implements InterruptHandler, Loggable {
@ -53,11 +50,10 @@ public abstract class IOUnit implements InterruptHandler, Loggable {
private StateChangeListener stateListener;
private int ioState;
protected int logLevel;
protected EmulationLogger logger;
private PrintStream log;
protected boolean DEBUG = false;
protected EmulationLogger logger;
public IOUnit(String id, MSP430Core cpu, int[] memory, int offset) {
this(id, id, cpu, memory, offset);
}
@ -79,8 +75,9 @@ public abstract class IOUnit implements InterruptHandler, Loggable {
@Override
public void setLogLevel(int l) {
logLevel = l;
DEBUG = logLevel == Loggable.DEBUG;
}
public void addStateChangeListener(StateChangeListener listener) {
stateListener = StateChangeListener.Proxy.INSTANCE.add(stateListener, listener);
}