-
Notifications
You must be signed in to change notification settings - Fork 210
LogView: Date column should be more fine grained #2963
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
base: master
Are you sure you want to change the base?
LogView: Date column should be more fine grained #2963
Conversation
This sounds like a reasonable thing to do. |
Does anyone from the other committers have any objections to merging this change? |
No objections, I really like this change. Just some technical part: -return dateFormat.format(entry.getDate());
+return entry.getFormattedDate(); That does internal caching of the log date string and might optimize things a bit. Then, we could also give Then get rid off the additional |
try { | ||
date = formatter.parse(dateString); | ||
} catch (ParseException e) { // do nothing | ||
LocalDateTime ldt = LocalDateTime.parse(dateString, LOCAL_SDF); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LogEntry
does
Date date = Date.from(Instant.from(GREGORIAN_SDF.parse(stringToParse)));
if (date != null) {
fDate = date;
fDateString = LOCAL_SDF.format(fDate.toInstant());
}
Not sure what the difference is exactly and why we need a gregorian_sdf also, but since LogEntry is the probably more mature implementation, mabye
- make
org.eclipse.ui.internal.views.log.LogEntry.GREGORIAN_SDF
andorg.eclipse.ui.internal.views.log.LogEntry.LOCAL_SDF
package-protected - use the constant from over there and just use the same parsing logic here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit more refactoring than I intended to do, but here we go :) f916646
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @chrisrueger 👍 :)
- and show yyyy-MM-dd HH:mm:ss.SSS instead of just minute precision - this is useful where you want to see the exact time of log events in cases where seconds or even milliseconds matter add and use getFormattedDate() reuse LogEntry DateTimeFormatters fix potential NPE in case somebody calls getFormattedDate before setDate() was called
a1fca3a
to
3f131ea
Compare
yyyy-MM-dd HH:mm:ss.SSS
instead of just minute precisionShows this:
instead of