forked from I2P_Developers/i2p.i2p
Util: Consolidate and standardize date/time formatting (ticket #2016)
This commit is contained in:
@@ -5,13 +5,12 @@ import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.util.I2PThread;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
@@ -125,7 +124,6 @@ public class BufferedStatLog implements StatLog {
|
||||
}
|
||||
|
||||
private class StatLogWriter implements Runnable {
|
||||
private final SimpleDateFormat _fmt = new SimpleDateFormat("yyyyMMdd HH:mm:ss.SSS");
|
||||
public void run() {
|
||||
int writeStart = -1;
|
||||
int writeEnd = -1;
|
||||
@@ -162,10 +160,7 @@ public class BufferedStatLog implements StatLog {
|
||||
int cur = start;
|
||||
while (cur != end) {
|
||||
//if (shouldLog(_events[cur].getStat())) {
|
||||
String when = null;
|
||||
synchronized (_fmt) {
|
||||
when = _fmt.format(new Date(_events[cur].getTime()));
|
||||
}
|
||||
String when = DataHelper.formatTime(_events[cur].getTime());
|
||||
_out.write(when);
|
||||
_out.write(" ");
|
||||
if (_events[cur].getScope() == null)
|
||||
|
||||
Reference in New Issue
Block a user