Skip to content

Commit

Permalink
LogMessage is conform to Hashable
Browse files Browse the repository at this point in the history
Signed-off-by: Wouter01 <[email protected]>
  • Loading branch information
Wouter01 committed May 22, 2023
1 parent cb9e7cd commit afd2422
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/LogStream/LogMessage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import OSLog

/// Represents a log message captured from the activity logs.
public struct LogMessage {
public struct LogMessage: Hashable {
/// The log message string.
public let message: String

Expand Down
14 changes: 14 additions & 0 deletions Sources/LogStream/OSLogType+Hashable.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// OSLogType+Hashable.swift
//
//
// Created by Wouter Hennen on 22/05/2023.
//

import OSLog

extension OSLogType: Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(self.rawValue)
}
}

0 comments on commit afd2422

Please sign in to comment.