changed console println to log messages

This commit is contained in:
hneemann 2017-03-27 19:01:28 +02:00
parent 2f0277488b
commit deff384e03

View File

@ -7,6 +7,8 @@ import de.neemann.digital.gui.GuiModelObserver;
import de.neemann.digital.gui.StatusInterface; import de.neemann.digital.gui.StatusInterface;
import de.neemann.digital.gui.sync.Sync; import de.neemann.digital.gui.sync.Sync;
import de.neemann.digital.lang.Lang; import de.neemann.digital.lang.Lang;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.ScheduledThreadPoolExecutor;
@ -20,6 +22,8 @@ import java.util.concurrent.TimeUnit;
* @author hneemann * @author hneemann
*/ */
public class RealTimeClock implements ModelStateObserver { public class RealTimeClock implements ModelStateObserver {
private static final Logger LOGGER = LoggerFactory.getLogger(RealTimeClock.class);
private final Model model; private final Model model;
private final ScheduledThreadPoolExecutor executor; private final ScheduledThreadPoolExecutor executor;
private final ErrorStopper stopper; private final ErrorStopper stopper;
@ -115,7 +119,7 @@ public class RealTimeClock implements ModelStateObserver {
thread = new Thread() { thread = new Thread() {
@Override @Override
public void run() { public void run() {
System.out.println("thread start"); LOGGER.debug("thread start");
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
long counter = 0; long counter = 0;
try { try {
@ -131,9 +135,9 @@ public class RealTimeClock implements ModelStateObserver {
} }
time = System.currentTimeMillis() - time; time = System.currentTimeMillis() - time;
status.setStatus(counter / time / 2 + "kHz"); final long l = counter / time / 2;
status.setStatus(l + "kHz");
System.out.println("thread end"); LOGGER.debug("thread end, f="+l+"kHz");
} }
}; };
thread.setDaemon(true); thread.setDaemon(true);