Skip to content

How to 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:


@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
}

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
}