OSLog Logger & SwiftUI

Hi,

Are there any macros that can be used with Logger to automatically capture the SwiftUI function that the message originates from? Currently, I am using something similar to:

Logger.misc.error("In \(#fileID), \(#function): \(error)")

Currently, the #function only tells me that it originates in body... Ideally, I'd like to be able to tell if it was with an onAppear, onChange, Button, alert, etc... I realize I can manually enter this, but was wondering if there was a more automated way to capture this info.

Thx,

OSLog Logger & SwiftUI
 
 
Q