Skip to content

Commit

Permalink
libdeng2|Log: Print log entry timestamp using seconds since start
Browse files Browse the repository at this point in the history
More compact and informative than omitting the hour.
  • Loading branch information
skyjake committed Jan 30, 2014
1 parent 7ec77ab commit c9152b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doomsday/libdeng2/include/de/data/time.h
Expand Up @@ -125,7 +125,7 @@ class DENG2_PUBLIC Time : public ISerializable
enum Format {
ISOFormat,
BuildNumberAndTime,
BuildNumberAndTimeWithoutHour,
BuildNumberAndSecondsSinceStart,
FriendlyFormat,
ISODateOnly,
CompilerDateTime // Oct 7 2013 03:18:36 (__DATE__ __TIME__)
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libdeng2/src/core/log.cpp
Expand Up @@ -352,7 +352,7 @@ String LogEntry::asText(Flags const &formattingFlags, int shortenSection) const
// Begin with the timestamp.
if(flags.testFlag(Styled)) output << TEXT_STYLE_LOG_TIME;

output << _when.asText(Date::BuildNumberAndTimeWithoutHour) << " ";
output << _when.asText(Date::BuildNumberAndSecondsSinceStart) << " ";

if(!flags.testFlag(OmitDomain))
{
Expand Down
5 changes: 3 additions & 2 deletions doomsday/libdeng2/src/data/time.cpp
Expand Up @@ -306,9 +306,10 @@ String Time::asText(Format format) const
{
return d->dateTime.toString(Qt::TextDate);
}
else if(format == BuildNumberAndTimeWithoutHour)
else if(format == BuildNumberAndSecondsSinceStart)
{
return QString("#%1 ").arg(asBuildNumber(), -4) + d->dateTime.toString("mm:ss.zzz");
return QString("#%1 %2").arg(asBuildNumber(), -4)
.arg(highPerfTimer.elapsed(), 7, 'f', 3, '0');
}
else
{
Expand Down

0 comments on commit c9152b1

Please sign in to comment.