The SDMLogger is a programming interface that provides event logging facilities. Its APIs allow generating, retrieving and displaying log items for a specific application.
SDMLOGEMERGENCY(msg) SDMLOGALERT(msg) SDMLOGCRITICAL(msg) SDMLOGERROR(msg) SDMLOGWARNING(msg) SDMLOGNOTICE(msg) SDMLOGINFO(msg) SDMLOGDEBUG(msg)
+ (void) enableLogging + (void) disableLogging -(void) displayLogsWithLevel:(LoggingLevels)level_in -(void) displayLogsWithLevel:(LoggingLevels)level_in forQueryOperation:(QueryOperations)queryOperation; -(NSArray*) retrieveLogsWithLevel:(LoggingLevels)level_in; -(NSArray*) retrieveLogsWithLevel:(LoggingLevels)level_in forQueryOperation:(QueryOperations)queryOperation; -(void) logMessage:(NSString*) message_in withLevel:(LoggingLevels)level_in andInfo:(NSString*) info_in -(void) logEmergency:(NSString*) message_in withInfo:(NSString*) info_in -(void) logAlert:(NSString*) message_in withInfo:(NSString*) info_in -(void) logCritical:(NSString*) message_in withInfo:(NSString*) info_in -(void) logError:(NSString*) message_in withInfo:(NSString*) info_in -(void) logWarning:(NSString*) message_in withInfo:(NSString*) info_in -(void) logNotice:(NSString*) message_in withInfo:(NSString*) info_in -(void) logInfo:(NSString*) message_in withInfo:(NSString*) info_in -(void) logDebug:(NSString*) message_in withInfo:(NSString*) info_in
You can enable/disable logging, and display, retrieve and generate logs.
[[SDMLogger instance] displayLogsWithLevel:DebugLoggingLevel forQueryOperation:LessEqual];
When generating logs, consider using the SDMLOGxxx macros, because they automatically enhance the log entry with information such as FILE, FUNCTION and LINE#.
The common methods are defined by the SDMLogging protocol. (See also: SDMLogger default implementation.)
The built-in crash log support provided by Apple can be used additionally for supportability purposes. You can retrieve crash logs either by using iTunes or by using the iPhone Configuration Utility. Note that Apple imposes restrictions on an application transmitting any data about the user without the user's prior permission, as described in the App Store review guidelines at http://developer.apple.com/appstore/resources/approval/guidelines.html, see Chapter 17, Privacy.