Skip to content

Commit

Permalink
refactor(cli): improve log deduplication
Browse files Browse the repository at this point in the history
  • Loading branch information
heapwolf committed Jun 22, 2024
1 parent 1726f60 commit 27b37ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cli/cli.cc
Original file line number Diff line number Diff line change
Expand Up @@ -361,14 +361,14 @@ unsigned short createLogSocket() {
int count = 0;
id logEntry;

NSString *lastMessage;
NSDate *timestamp = [NSDate date];
while ((logEntry = [enumerator nextObject]) != nil) {
count++;
OSLogEntryLog *entry = (OSLogEntryLog *)logEntry;
NSString *message = [entry composedMessage];
if ([message isEqualToString:lastMessage]) continue;
if ([entry.timestamp isEqualToDate:timestamp]) continue;

lastMessage = message;
NSString *message = [entry composedMessage];
timestamp = entry.timestamp;
std::cout << message.UTF8String << std::endl;
}
}
Expand Down

0 comments on commit 27b37ba

Please sign in to comment.