Add filename, functionname, linenumber to error log.

This commit is contained in:
Brent Simmons committed 2026-03-12 20:53:26 -07:00
1 parent e94cfc3a7a
commit cfb561d4b2
9 files changed
+54 -22

No files matched your search

@@ -19,13 +19,19 @@ public struct ErrorLogUserInfoKey {
public static let sourceName = "sourceName"
public static let sourceID = "sourceID" // 0-99 are AccountType raw values. 100 and greater are for other components.
public static let operation = "operation"
public static let fileName = "fileName"
public static let functionName = "functionName"
public static let lineNumber = "lineNumber"
public static let errorMessage = "errorMessage"
public static func userInfo(sourceName: String, sourceID: Int, operation: String, errorMessage: String) -> [String: Any] {
public static func userInfo(sourceName: String, sourceID: Int, operation: String, errorMessage: String, fileName: String = #fileID, functionName: String = #function, lineNumber: Int = #line) -> [String: Any] {
[
Self.sourceName: sourceName,
Self.sourceID: sourceID,
Self.operation: operation,
Self.fileName: fileName,
Self.functionName: functionName,
Self.lineNumber: lineNumber,
Self.errorMessage: errorMessage
]
}