git://git.nikiroo.be
/
nikiroo-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New: SearchBar
[nikiroo-utils.git]
/
src
/
be
/
nikiroo
/
utils
/
TraceHandler.java
diff --git
a/src/be/nikiroo/utils/TraceHandler.java
b/src/be/nikiroo/utils/TraceHandler.java
index 12ae849b0d267e56d2971937b87b5c0765de73c6..0a09712d5218013992493838c75ad9aa0ad92527 100644
(file)
--- a/
src/be/nikiroo/utils/TraceHandler.java
+++ b/
src/be/nikiroo/utils/TraceHandler.java
@@
-91,9
+91,11
@@
public class TraceHandler {
public void error(Exception e) {
if (showErrors) {
if (showErrorDetails) {
public void error(Exception e) {
if (showErrors) {
if (showErrorDetails) {
+ long now = System.currentTimeMillis();
+ System.err.print(StringUtils.fromTime(now) + ": ");
e.printStackTrace();
} else {
e.printStackTrace();
} else {
- error(e.
getMessage
());
+ error(e.
toString
());
}
}
}
}
}
}
@@
-106,7
+108,8
@@
public class TraceHandler {
*/
public void error(String message) {
if (showErrors) {
*/
public void error(String message) {
if (showErrors) {
- System.err.println(message);
+ long now = System.currentTimeMillis();
+ System.err.println(StringUtils.fromTime(now) + ": " + message);
}
}
}
}
@@
-139,7
+142,10
@@
public class TraceHandler {
*/
public void trace(String message, int level) {
if (traceLevel > 0 && level <= traceLevel) {
*/
public void trace(String message, int level) {
if (traceLevel > 0 && level <= traceLevel) {
+ long now = System.currentTimeMillis();
+ System.err.print(StringUtils.fromTime(now) + ": ");
if (maxPrintSize > 0 && message.length() > maxPrintSize) {
if (maxPrintSize > 0 && message.length() > maxPrintSize) {
+
System.err
.println(message.substring(0, maxPrintSize) + "[...]");
} else {
System.err
.println(message.substring(0, maxPrintSize) + "[...]");
} else {