Set up logging
To receive log messages from the SDK, confirm the PGLoggingDelegate
protocol, set the PGLogging
property and all the logs will be retrieved via PGLog:flag:context:file:function:line:tag:message:
method:
Example 116. Objective C
… @interface AppLogger () <NSObject, PGLoggingDelegate> … PGLogging.delegate … - (void)PGLog:(BOOL)asynchronous flag:(PGLogFlag)flag context:(NSInteger)context file:(NSString * _Nonnull)file function:(NSString * _Nonnull)function line:(NSUInteger)line tag:(nullable id)tag message:(NSString * _Nonnull)message { //Handle received messages }
Example 117. Swift
… class AppLogger: NSObject, PGLoggingDelegate … PGLogging.delegate = self … func pgLog(_ asynchronous: Bool, flag: PGLogFlag, context: Int, file: String, function: String, line: UInt, tag: Any?, message: String) { //Handle received log messages }