Splunk MINT SDK for iOS

Splunk MINT SDK for iOS Developer Guide

Download manual as PDF

Download topic as PDF

Dispatch system log messages

Print device log messages

With the MintLog function you can print messages to the console using the Apple Logging System (ALS). When in debug mode, all messages are displayed in the console window and printed to the device log. When in release mode, all messages are displayed in the console window, but only notice messages and higher are printed to the device log.

Log Level Suggested Usage
Emergency (level 0) The highest priority, usually reserved for catastrophic failures and reboot notices.
Alert (level 1) A serious failure in a key system.
Critical (level 2) A failure in a key system.
Error (level 3) Something has failed.
Warning (level 4) Something is amiss and might fail if not corrected.
Notice (level 5) Things of moderate interest to the user or administrator.
Info (level 6) The lowest priority that you would normally log, and purely informational in nature.
Debug (level 7) The lowest priority, and normally not logged except for messages from the kernel.

Report console log messages

To dispatch the latest NSLog messages with your unhandled crash, use the following methods before calling initAndStartSessionWithAPIKey::

  • enableMintLoggingCache: enables log caching.
  • enableLogging: attaches the cached log to exceptions.
  • setLogging: specifies the number of lines to include.

Example code

// Objective-C

[[Mint sharedInstance] enableMintLoggingCache:YES];

[[Mint sharedInstance] enableLogging:YES];

[[Mint sharedInstance] setLogging:8];

[[Mint sharedInstance] initAndStartSessionWithAPIKey:@"API_KEY"];
// Swift 

Mint.sharedInstance().enableMintLoggingCache(true)

Mint.sharedInstance().enableLogging(true)

Mint.sharedInstance().setLogging(8)

Mint.sharedInstance().initAndStartSessionWithAPIKey("API_KEY")

Using this code, your unhandled crash reports will include the last eight NSLog messages with the request, which you can then examine from the error instances.

PREVIOUS
Add and report events
  NEXT
Report handled exceptions

This documentation applies to the following versions of Splunk MINT SDK for iOS: 5.2.x


Was this documentation topic helpful?

Enter your email address, and someone from the documentation team will respond to you:

Please provide your comments here. Ask a question or make a suggestion.

You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters