Collect logs
The Readers SDK provides a mechanism to collect logs, when the Readers SDK is initialized it's possible to provide an implementation of an interface Logger that will collects logs. Use your own implementation of this class to collect logs and bug reports.
- iOS
- Android
- React Native
Implements SDKLogger
protocol
struct CustomSDKLogger: SDKLogger {
func log(message: String, level: LogLevel) {
//...
}
}
The log method receives the log message and log level(debug, info, notice, error).
Implements SDKLogger
Interface.
class CustomSDKLogger : SDKLogger {
override fun log(tag: String, message: String, level: SDKLogger.LogLevel) {
...
}
}
Implements Logger
Interface.
class SDKLogger implements Logger {
log(tag: string, message: string, level: LogLevel) {
console.log(`SDKLogger - [${tag}][${level}] ${message}`)
}
}
💡 Use memoized SDKLogger so react doesn't re-render every time the logger changes
See React useMemo for deep understanding
const sdkLogger = useMemo(() => new SDKLogger(), [])
return (
<ReadersSdkProvider
endpoint={"https://some-endpoint.geopagos.com/"}
logger={sdkLogger}
readers={[urovoInstaller(UrovoProfiles.ARGENTINA)]}
applicationKey={"SOME_APPLICATION_KEY"}
>
...
</ReadersSdkProvider>
)