A Cordova plugin to retrieve native logs directly from your app to let your users easily share them with you for troubleshooting
Those logs will be identical to the ones retrieved by the adb logcat
command (Android), or displayed in XCode debugger (iOS)
- iOS
- Android
cordova plugin add cordova-plugin-native-logs
cordova plugin remove cordova-plugin-native-logs
NativeLogs.getLog(_nbLines,_bCopyToClipboard,_successCB)
Returns the latest available logs.
_nbLines
: number max of lines to retrieve_bCopyToClipboard
: copy the logs to the clipboard to let the user easily share it_successCB
: callback that will retrieve the log as a string
NativeLogs.getLog(1000,false, function(_logs) {
// do something w/ the logs
}
To use the plugin in your project, just add this declaration :
declare var NativeLogs:any;
A complete functional sample is available in the sample/
directory in the github website: https://github.com/ogoguel/cordova-plugin-native-logs
To build it :
cd sample/
ionic state reset
ionic run ios
ionic run android
This plugin can be used in conjunction with mail composer plugin to let the user send the log via email
- v1.0.5 Fix version mismatched
- v1.0.4 Fix NPM deployment
- v1.0.3 Fix invalid log count (cf. issue #1)
- v1.0.2 Fix typo in documentation
- v1.0.1 Initial release