mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-30 01:10:38 +00:00
Add filename, functionname, linenumber to error log.
This commit is contained in:
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
|
||||
]
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user