Custom Logging
Recording key events and managed errors to boost app reliability and debugging efficiency
Logging Messages and Capturing Handled Exceptions enhances app reliability by recording key events and errors during app execution.
Log Messaage
Logs various types of informational, debug, warning, or error messages to capture events, notifications, or actions within the application.
import ZipyiOS
// Simple message logging
Zipy.logMessage("User completed onboarding")
// With additional context
Zipy.logMessage(
"Payment processed",
exceptionObj: ["amount": 99.99, "currency": "USD"]
)
// With custom message length
Zipy.logMessage(
"Detailed process log...",
exceptionObj: ["processId": "12345"],
maxLength: 2000
)
Log Errors
Logs all the error, providing all the details you pass for debugging. Captures and records error events within your application
// Simple error logging
Zipy.logError("Failed to process payment")
// With error object
let error = NSError(
domain: "PaymentError",
code: 401,
userInfo: [NSLocalizedDescriptionKey: "Invalid card"]
)
Zipy.logError("Payment failed", exceptionObj: error)
Log Exceptions
Logs exceptions encountered by the application, providing detailed stack traces and context to aid in debugging and troubleshooting. This feature ensures critical data is logged promptly to diagnose and resolve issues.
// Simple exception logging
Zipy.logException("Unexpected data format")
// With exception details
do {
// Your code that might throw
} catch {
Zipy.logException(
"Data processing failed",
exceptionObj: error
)
}
Note: For custom logging, if maxLength
is not provided, it will default to capturing the full length.
Last updated