mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
fix: accurate timestamp in daemon logs (#7009)
* fix: accurate timestamp in daemon logs * fix: gtk build errors * fixup! fix: gtk build errors * code review: use system_clock typedefs * code review: use the full buffer for string view * fixup! fix: accurate timestamp in daemon logs * code review: limit exposure of `using`
This commit is contained in:
@@ -250,9 +250,10 @@ static NSTimeInterval const kUpdateSeconds = 0.75;
|
||||
auto const file_string = std::string{ currentMessage->file };
|
||||
NSString* file = [(@(file_string.c_str())).lastPathComponent stringByAppendingFormat:@":%ld", currentMessage->line];
|
||||
|
||||
auto const secs_since_1970 = std::chrono::system_clock::to_time_t(currentMessage->when);
|
||||
NSDictionary* message = @{
|
||||
@"Message" : @(currentMessage->message.c_str()),
|
||||
@"Date" : [NSDate dateWithTimeIntervalSince1970:currentMessage->when],
|
||||
@"Date" : [NSDate dateWithTimeIntervalSince1970:secs_since_1970],
|
||||
@"Index" : @(currentIndex++), //more accurate when sorting by date
|
||||
@"Level" : @(currentMessage->level),
|
||||
@"Name" : name,
|
||||
|
||||
Reference in New Issue
Block a user