PCSDKModule Documentation

Protocol PCLogger​Protocol

public protocol PCLoggerProtocol  

The protocol to implement external logger

To use your logger, implement your own object that will inherit this protocol. For example:

final class MyLogger: PCLoggerProtocol {

    func debug(_ message: String, category: PCLoggingCategory) {
        ...
    }

    func error(_ message: String, category: PCLoggingCategory) {
        ...
    }

    func sensitive(_ message: String, category: PCLoggingCategory) {
        #if DEBUG
        // Process sensitive information only in DEBUG mode to keep safe
        // user's sensitive data, e.g. symmetric keys values, personal data etc.
        ...
        #endif
    }

}

Then pass it to the PCSDK.setLogger(...) method:

let myLogger = MyLogger()
PCSDK.setLogger(myLogger, options: [.debug, .sensitive])

Requirements

debug(_:​category:​)

func debug(_ message: String, category: PCLoggingCategory) 

Common messages

Parameters

message String

The message

category PCLogging​Category

The category

error(_:​category:​)

func error(_ message: String, category: PCLoggingCategory) 

Errors

Parameters

message String

The message

category PCLogging​Category

The category

sensitive(_:​category:​)

func sensitive(_ message: String, category: PCLoggingCategory) 

Sensitive information. E.g. keys, requests with user's personal info.

Parameters

message String

The message

category PCLogging​Category

The category