Skip to content

Commit

Permalink
Add SYSLOG_IDENTIFIER as part of the entry comparison statement.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonystone committed Jun 1, 2018
1 parent 4bc9738 commit b98c432
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Tests/TraceLogJournalWriterTests/SDJournalWriterTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,13 @@ private func journalEntryExists(for input: (timestamp: Double, level: LogLevel,
///
/// These should be all the fields we pass to systemd journal.
///
if journalEntry["PRIORITY"] as? String ?? "" == String(writer.convertLogLevel(for: input.level)) &&
journalEntry["CODE_FILE"] as? String ?? "" == input.staticContext.file &&
journalEntry["CODE_LINE"] as? String ?? "" == String(input.staticContext.line) &&
journalEntry["CODE_FUNC"] as? String ?? "" == input.staticContext.function &&
journalEntry["MESSAGE"] as? String ?? "" == input.message &&
journalEntry["TAG"] as? String ?? "" == input.tag {
if journalEntry["SYSLOG_IDENTIFIER"] as? String ?? "" == syslogIdentifier &&
journalEntry["PRIORITY"] as? String ?? "" == String(writer.convertLogLevel(for: input.level)) &&
journalEntry["CODE_FILE"] as? String ?? "" == input.staticContext.file &&
journalEntry["CODE_LINE"] as? String ?? "" == String(input.staticContext.line) &&
journalEntry["CODE_FUNC"] as? String ?? "" == input.staticContext.function &&
journalEntry["MESSAGE"] as? String ?? "" == input.message &&
journalEntry["TAG"] as? String ?? "" == input.tag {

return true
}
Expand Down

0 comments on commit b98c432

Please sign in to comment.