git://wamblee.org
/
utils
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(no commit message)
[utils]
/
support
/
general
/
src
/
main
/
java
/
org
/
wamblee
/
io
/
SimpleProcess.java
diff --git
a/support/general/src/main/java/org/wamblee/io/SimpleProcess.java
b/support/general/src/main/java/org/wamblee/io/SimpleProcess.java
index 5e18b16cb7a97c7375fb4b0842e962f3a4c74680..c08f001da84910d26e8b74a2be72968f78503a26 100644
(file)
--- a/
support/general/src/main/java/org/wamblee/io/SimpleProcess.java
+++ b/
support/general/src/main/java/org/wamblee/io/SimpleProcess.java
@@
-23,9
+23,8
@@
import java.io.InputStreamReader;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Arrays;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Arrays;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Level;
+import java.util.logging.Logger;
/**
*
/**
*
@@
-33,7
+32,7
@@
import org.apache.commons.logging.LogFactory;
* @version $Revision$
*/
public class SimpleProcess {
* @version $Revision$
*/
public class SimpleProcess {
- private static final Log
LOG = LogFactory.getLog(SimpleProcess.class
);
+ private static final Log
ger LOG = Logger.getLogger(SimpleProcess.class.getName()
);
private File directory;
private File directory;
@@
-88,7
+87,7
@@
public class SimpleProcess {
fullcmd.append(" " + part);
}
fullcmd.append(" " + part);
}
- LOG.
debug
("Executing '" + fullcmd + "' in directory '" + directory +
+ LOG.
fine
("Executing '" + fullcmd + "' in directory '" + directory +
"'");
java.lang.Process proc = Runtime.getRuntime().exec(cmd, null,
"'");
java.lang.Process proc = Runtime.getRuntime().exec(cmd, null,
@@
-119,9
+118,9
@@
public class SimpleProcess {
stderr = myStderr.toString();
if (proc.exitValue() != 0) {
stderr = myStderr.toString();
if (proc.exitValue() != 0) {
- LOG.warn("Exit value was non-zero: " + this);
+ LOG.warn
ing
("Exit value was non-zero: " + this);
} else {
} else {
- LOG.
debug
("Process finished");
+ LOG.
fine
("Process finished");
}
return proc.exitValue();
}
return proc.exitValue();
@@
-138,8
+137,8
@@
public class SimpleProcess {
aReaderThread.join();
} catch (InterruptedException e) {
LOG
aReaderThread.join();
} catch (InterruptedException e) {
LOG
- .
warn(
this +
- ": error waiting for output stream reader of process to finish");
+ .
log(Level.WARNING,
this +
+ ": error waiting for output stream reader of process to finish"
, e
);
}
}
}
}
@@
-156,18
+155,18
@@
public class SimpleProcess {
String str;
while ((str = br.readLine()) != null) {
String str;
while ((str = br.readLine()) != null) {
- LOG.
debug
(aPrefix + str);
+ LOG.
fine
(aPrefix + str);
aOutput.write(str);
}
} catch (IOException e) {
aOutput.write(str);
}
} catch (IOException e) {
- LOG.
warn(
SimpleProcess.this +
+ LOG.
log(Level.FINE,
SimpleProcess.this +
": error reading input stream", e);
} finally {
if (br != null) {
try {
br.close();
} catch (IOException e) {
": error reading input stream", e);
} finally {
if (br != null) {
try {
br.close();
} catch (IOException e) {
- LOG.
warn("Error closing stream " + aPrefix
);
+ LOG.
log(Level.WARNING, "Error closing stream " + aPrefix, e
);
}
}
}
}
}
}