diff --git a/Sources/LogStream/LogMessage.swift b/Sources/LogStream/LogMessage.swift index ed9ae9e..38fb390 100644 --- a/Sources/LogStream/LogMessage.swift +++ b/Sources/LogStream/LogMessage.swift @@ -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 diff --git a/Sources/LogStream/OSLogType+Hashable.swift b/Sources/LogStream/OSLogType+Hashable.swift new file mode 100644 index 0000000..3e154ad --- /dev/null +++ b/Sources/LogStream/OSLogType+Hashable.swift @@ -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) + } +}