Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logs always show the same timestamp #743

Merged
merged 1 commit into from
Aug 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;

import org.eclipse.core.runtime.ILogListener;
import org.eclipse.core.runtime.IStatus;
Expand All @@ -32,7 +32,6 @@ public class LogHandler {
private DateFormat dateFormat;
private int logLevelMask;
private JavaClientConnection connection;
private Calendar calendar;
private ILogFilter filter;

public LogHandler() {
Expand All @@ -46,7 +45,6 @@ public LogHandler(ILogFilter filter) {
public void install(JavaClientConnection rcpConnection) {
this.dateFormat = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
this.logLevelMask = getLogLevelMask(System.getProperty("log.level", ""));//Empty by default
this.calendar = Calendar.getInstance();
this.connection = rcpConnection;

this.logListener = new ILogListener() {
Expand Down Expand Up @@ -80,7 +78,7 @@ private void processLogMessage(IStatus status) {
//no op;
return;
}
String dateString = this.dateFormat.format(this.calendar.getTime());
String dateString = this.dateFormat.format(new Date());
String message = status.getMessage();
if (status.getException() != null) {
message = message + '\n' + status.getException().getMessage();
Expand Down