rosecoder/google-cloud-error-reporting-swift
This package provides a Swift implementation for error reporting on the Google Cloud Platform.
Example usage
import GoogleCloudErrorReporting
let errorReportingService = ErrorReportingService()
Task { try await errorReportingService.run() }
try await service.report(
date: Date(),
message: "Error doing testing",
source: "error-reporting.test",
file: #file,
function: #function,
line: #line
)This will automatically authenticate with Google Cloud and send errors to Cloud Error Reporting.
See Google Cloud Auth for Swift for supported authentication methods.
Log handler
There's also a log handler which can be used with SwiftLog.
import Logging
import GoogleCloudErrorReporting
let errorReportingService = ErrorReportingService()
Task { try await errorReportingService.run() }
LoggingSystem.bootstrap { label in
ErrorReportingLogHandler(service: errorReportingService, label: label)
}Package Metadata
Repository: rosecoder/google-cloud-error-reporting-swift
Default branch: main
README: README.md