Skip to content

Commit

Permalink
remove system.out references
Browse files Browse the repository at this point in the history
  • Loading branch information
bobjacobsen committed Sep 26, 2019
1 parent 29007dc commit 27311ad
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 17 deletions.
9 changes: 4 additions & 5 deletions java/src/jmri/jmrit/Sound.java
Expand Up @@ -19,8 +19,6 @@
import javax.sound.sampled.SourceDataLine;
import javax.sound.sampled.UnsupportedAudioFileException;
import jmri.util.FileUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Provide simple way to load and play sounds in JMRI.
Expand All @@ -45,7 +43,6 @@ public class Sound {
private boolean streamingStop = false;
private AtomicReference<Clip> clipRef = new AtomicReference<>();
private boolean autoClose = true;
private final static Logger log = LoggerFactory.getLogger(Sound.class);

/**
* Create a Sound object using the media file at path
Expand Down Expand Up @@ -308,7 +305,7 @@ public WavBuffer(byte[] content) {
+ buffer[index + 5] * 256
+ buffer[index + 6] * 256 * 256
+ buffer[index + 7] * 256 * 256 * 256;
System.out.println("index now " + index);
log.debug("index now {}", index);
}
}
log.error("Didn't find fmt chunk");
Expand Down Expand Up @@ -383,7 +380,7 @@ public void run() {
format.getFrameRate(), true); // big endian
// update stream and format details
stream = AudioSystem.getAudioInputStream(newFormat, stream);
System.out.println("Converted Audio format: " + newFormat);
log.info("Converted Audio format: {}", newFormat);
format = newFormat;
log.debug("new converted Audio format: " + format);
}
Expand Down Expand Up @@ -460,4 +457,6 @@ private void setSensor(int mode) {
}

}

private final static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Sound.class);
}
9 changes: 7 additions & 2 deletions java/src/jmri/jmrit/decoderdefn/DecoderIndexBuilder.java
@@ -1,7 +1,10 @@
package jmri.jmrit.decoderdefn;

/**
* Update the decoder index and store as a command-line action
* Update the decoder index and store as a command-line action.
* <P>
* Not intended to be referenced from within JMRI itself, as this
* reconfigures logging for standalone operation.
*
* @author Bob Jacobsen Copyright (C) 2001, 2011, 2014
* @author Randall Wood Copyright (C) 2013
Expand All @@ -11,6 +14,8 @@ public class DecoderIndexBuilder {

// main entry point to run standalone
static public void main(String[] args) {

// logging needed for code invoked from here
String logFile = "default.lcf";
try {
if (new java.io.File(logFile).canRead()) {
Expand All @@ -22,7 +27,7 @@ static public void main(String[] args) {
System.out.println("Exception starting logging: " + e);
}

// print the location where the result is stored
// log the location where the result is stored
System.out.println(jmri.util.FileUtil.getUserFilesPath() + "decoderIndex.xml"); // command line

// recreate the index
Expand Down
3 changes: 1 addition & 2 deletions java/src/jmri/jmrit/dispatcher/AutoActiveTrain.java
Expand Up @@ -1419,8 +1419,7 @@ private synchronized void setTargetSpeedByProfile(float speedState) {
_autoEngineer.setHalt(true);
}
} catch (Exception ex) {
log.error("setTargetSpeedByProfile crashed - Emergency Stop: " );
ex.printStackTrace();
log.error("setTargetSpeedByProfile crashed - Emergency Stop: ", ex );
_autoEngineer.slowToStop(false);
_targetSpeed = -1.0f;
_autoEngineer.setHalt(true);
Expand Down
6 changes: 2 additions & 4 deletions java/src/jmri/jmrit/logix/Warrant.java
Expand Up @@ -15,8 +15,6 @@
import jmri.ThrottleListener;
import jmri.implementation.SignalSpeedMap;
import jmri.util.ThreadingUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* An Warrant contains the operating permissions and directives needed for a
Expand Down Expand Up @@ -1643,7 +1641,7 @@ public void run() {
javax.swing.SwingUtilities.invokeAndWait(allocateBlocks);
}
catch (Exception e) {
e.printStackTrace();
log.error("Exception in allocateBlocks", e);
}
}
};
Expand Down Expand Up @@ -2819,5 +2817,5 @@ public int hashCode() {
return (getSystemName().concat(_speedUtil.getDccAddress().toString())).hashCode();
}

private final static Logger log = LoggerFactory.getLogger(Warrant.class);
private final static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Warrant.class);
}
1 change: 0 additions & 1 deletion java/src/jmri/jmrit/ussctc/TrafficRelay.java
Expand Up @@ -35,7 +35,6 @@ public TrafficRelay(SignalHeadSection signal, CodeGroupThreeBits direction, Bean
this.farSignal = signal;
this.direction = direction;
this.beans = beans;
System.out.println("bean count "+beans.length);
}

SignalHeadSection farSignal;
Expand Down
Expand Up @@ -690,8 +690,7 @@ public boolean importData(JComponent c, Transferable t) {
try {
eventInJmriFormat = (String) t.getTransferData(DataFlavor.stringFlavor);
} catch (Exception e) {
log.error("unable to get dragged address");
e.printStackTrace();
log.error("unable to get dragged address", e);
return false;
}

Expand Down
Expand Up @@ -195,7 +195,7 @@ public void readFile(String filename) {
File file = new File(filename);
try (FileInputStream fis = new FileInputStream(file)) {

System.out.println("Total file size to read (in bytes) : "
log.info("Total file size to read (in bytes) : "
+ fis.available());
fdata = new byte[fis.available()];
int i = 0;
Expand Down

0 comments on commit 27311ad

Please sign in to comment.