From fb1376e7432d52996bf3626d6df1700e36f020c0 Mon Sep 17 00:00:00 2001 From: Timur Sharifianov Date: Tue, 13 Feb 2024 13:58:08 +0100 Subject: [PATCH] Make use of StaticString --- Sources/Pulse/LoggerStore/LoggerStore+Event.swift | 6 +++--- Sources/Pulse/LoggerStore/LoggerStore.swift | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Pulse/LoggerStore/LoggerStore+Event.swift b/Sources/Pulse/LoggerStore/LoggerStore+Event.swift index 59d4cff90..4783d4133 100644 --- a/Sources/Pulse/LoggerStore/LoggerStore+Event.swift +++ b/Sources/Pulse/LoggerStore/LoggerStore+Event.swift @@ -25,14 +25,14 @@ extension LoggerStore { @available(*, deprecated, message: "Deprecated (added for backward compatibility)") public var session: UUID? = Session.current.id - public init(createdAt: Date, label: String, level: LoggerStore.Level, message: String, metadata: [String: String]?, file: String, function: String, line: UInt) { + public init(createdAt: Date, label: String, level: LoggerStore.Level, message: String, metadata: [String: String]?, file: StaticString, function: StaticString, line: UInt) { self.createdAt = createdAt self.label = label self.level = level self.message = message self.metadata = metadata - self.file = file - self.function = function + self.file = String(describing: file) + self.function = String(describing: function) self.line = line } diff --git a/Sources/Pulse/LoggerStore/LoggerStore.swift b/Sources/Pulse/LoggerStore/LoggerStore.swift index d174afcc7..b9f524fbe 100644 --- a/Sources/Pulse/LoggerStore/LoggerStore.swift +++ b/Sources/Pulse/LoggerStore/LoggerStore.swift @@ -280,7 +280,7 @@ public final class LoggerStore: @unchecked Sendable, Identifiable { extension LoggerStore { /// Stores the given message. - public func storeMessage(createdAt: Date? = nil, label: String, level: Level, message: String, metadata: [String: MetadataValue]? = nil, file: String = #file, function: String = #function, line: UInt = #line) { + public func storeMessage(createdAt: Date? = nil, label: String, level: Level, message: String, metadata: [String: MetadataValue]? = nil, file: StaticString = #file, function: StaticString = #function, line: UInt = #line) { handle(.messageStored(.init( createdAt: createdAt ?? configuration.makeCurrentDate(), label: label,