diff --git a/Sources/AppState/Application/Application+public.swift b/Sources/AppState/Application/Application+public.swift index f47765a..aa3d95a 100644 --- a/Sources/AppState/Application/Application+public.swift +++ b/Sources/AppState/Application/Application+public.swift @@ -673,16 +673,15 @@ public extension Application { _ column: Int = #column ) -> SecureState { let secureState = shared.value(keyPath: keyPath) - let debugMessage: String - - #if DEBUG - debugMessage = "🔑 Getting SecureState \(String(describing: keyPath)) -> \(secureState.value ?? "nil")" - #else - debugMessage = "🔑 Getting SecureState \(String(describing: keyPath))" - #endif log( - debug: debugMessage, + debug: { + #if DEBUG + "🔑 Getting SecureState \(String(describing: keyPath)) -> \(secureState.value ?? "nil")" + #else + "🔑 Getting SecureState \(String(describing: keyPath))" + #endif + }, fileID: fileID, function: function, line: line, diff --git a/Sources/AppState/PropertyWrappers/State/SecureState.swift b/Sources/AppState/PropertyWrappers/State/SecureState.swift index fa1d7f8..93997c7 100644 --- a/Sources/AppState/PropertyWrappers/State/SecureState.swift +++ b/Sources/AppState/PropertyWrappers/State/SecureState.swift @@ -38,16 +38,14 @@ import SwiftUI ).value } nonmutating set { - let debugMessage: String - - #if DEBUG - debugMessage = "🔑 Setting SecureState \(String(describing: keyPath)) = \(newValue ?? "nil")" - #else - debugMessage = "🔑 Setting SecureState \(String(describing: keyPath))" - #endif - Application.log( - debug: debugMessage, + debug: { + #if DEBUG + "🔑 Setting SecureState \(String(describing: keyPath)) = \(newValue ?? "nil")" + #else + "🔑 Setting SecureState \(String(describing: keyPath))" + #endif + }, fileID: fileID, function: function, line: line,