提交 bd83d25e authored 作者: Thomas Mueller's avatar Thomas Mueller

Less classes are loaded when using the database in embedded mode.

上级 12d611a2
......@@ -105,7 +105,6 @@ public class TraceSystem implements TraceWriter {
this.fileName = fileName;
updateLevel();
traces = SmallLRUCache.newInstance(100);
dateFormat = new SimpleDateFormat("MM-dd HH:mm:ss ");
}
private void updateLevel() {
......@@ -210,10 +209,11 @@ public class TraceSystem implements TraceWriter {
return levelFile;
}
private String format(String module, String s) {
synchronized (dateFormat) {
return dateFormat.format(new Date()) + module + ": " + s;
private synchronized String format(String module, String s) {
if (dateFormat == null) {
dateFormat = new SimpleDateFormat("MM-dd HH:mm:ss ");
}
return dateFormat.format(new Date()) + module + ": " + s;
}
public void write(int level, String module, String s, Throwable t) {
......
......@@ -213,6 +213,11 @@ public class WebServer implements Service {
}
String getStartDateTime() {
if (startDateTime == null) {
SimpleDateFormat format = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z", new Locale("en", ""));
format.setTimeZone(TimeZone.getTimeZone("GMT"));
startDateTime = format.format(new Date());
}
return startDateTime;
}
......@@ -272,12 +277,6 @@ public class WebServer implements Service {
// TraceSystem.traceThrowable(e);
// }
// }
SimpleDateFormat format = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z", new Locale("en", ""));
synchronized (format) {
format.setTimeZone(TimeZone.getTimeZone("GMT"));
startDateTime = format.format(new Date());
}
trace(startDateTime);
for (String[] lang : LANGUAGES) {
languages.add(lang[0]);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论