Open pj4533 opened 1 year ago
Support easy debugging of json responses too like this:
do {
// Attempt to deserialize the Data object to a JSON object
let jsonObject = try JSONSerialization.jsonObject(with: data, options: [])
// Convert the JSON object to a pretty-printed string
let decodedJsonData = try JSONSerialization.data(withJSONObject: jsonObject, options: [.prettyPrinted])
DebugLog.shared.log(String(data: decodedJsonData, encoding: .utf8) ?? "")
} catch {
print("Error converting Data to JSON decoded string: \(error)")
}
Replace my current debug logging with the proper API
https://developer.apple.com/documentation/os/logging