Splunk Mint Plugin
The Splunk Mint plugin provides a way of integrating Splunk Mint crash reporting into a Cordova app. There are two ways of configuring and starting it: via the config.xml
file, in which case Splunk Mint is started as soon as the plugin loads; and via a call to plugins.splunkmint.start
, in which case, Splunk Mint won't be started until this call completes.
Configuration via config.xml
There are three preferences available for configuration in the config.xnl
file:
splunk_android_api_key
, which specifies the Splunk API key for Android.splunk_ios_api_key
, which specifies the Splunk API key for iOS.splunk_extra_data
, which specifies any extra data to be uploaded in the event of a crash; this is a string representation of a JSON object whose values are all strings.
For example:
Calls
plugins.splunkmint.crash
This function is used purely for testing — do NOT use in a released app. On iOS, it will crash the app with a segmentation violation (SIGSEGV). When the app is restated, an error report should be uploaded to the Splunk Mint website.
{ // This will never be called 'cos we'll already have crashed} { // See above} pluginssplunkmint
plugins.splunkmint.enableLogCat
Enables a limited logcat to be sent along with a crash. Android only.
{ // Enabled} { // There was a problem} var options = 'enable': true // required 'loglines': 100 // optional 'filter': 'ActivityManager:I MyApp:D *:S' // optional; pluginssplunkmint;
plugins.splunkmint.leaveBreadcrumb
Add a breadcrumb to a potential crash report.
{ // done} { // There was a problem} pluginssplunkmint;
plugins.splunkmint.logEvent
Log an event.
{ // done} { // There was a problem} pluginssplunkmint;
plugins.splunkmint.logView
Log a view.
{ // done} { // There was a problem} pluginssplunkmint;
plugins.splunkmint.getTotalCrashesNum
Get the number of crashes since install. On iOS, this always returns 0
.
{ console;} { // There was a problem} pluginssplunkmint;
plugins.splunkmint.getLastCrashID
Gets the ID of the last crash or null
if there wasn't one. On iOS, this always returns null
.
{ console;} { // There was a problem} pluginssplunkmint;
plugins.splunkmint.transactionStart
Start a transaction with a given name.
{ // done} { // There was a problem} pluginssplunkmint;
plugins.splunkmint.transactionStop
Stop the transaction with the given name.
{ // done} { // There was a problem} pluginssplunkmint;
plugins.splunkmint.transactionCancel
Cancel the transaction with the given name for the given reason.
{ // done} { // There was a problem} var options = 'name': 'RequestX' 'reason': 'UserCancelled'; pluginssplunkmint;
plugins.splunkmint.flush
Flush pending items.
{ // done} { // There was a problem} pluginssplunkmint;
plugins.splunkmint.enableDebugLog
Enable debug logging
{ // done} { // There was a problem} pluginssplunkmint;
plugins.splunkmint.log
Write a log message from a given source at a specified level. Valid levels are "v"
(verbose), "d"
(debug, the default), "i"
(info), "w"
(warning) and "e"
(error). Note on iOS "v"
is the same as "w"
and the tag
field is ignored.
{ // done} { // There was a problem} var options = 'tag': 'MyApp' 'msg': 'Started loading screen...' 'priority': 'i'; pluginssplunkmint;