Customized Logging

You can implement your own logging system.

In addition to logging using predefined notifications (described in “The Notification System”), you can implement your own logging system that uses your own log messages and messages generated by the PSDK. You can use these logs to assist with troubleshooting your player applications and to provide better understanding of the playback and advertising workflow.

Customized logging uses a shared singleton instance of the PSDKPTLogFactory, which provides a mechanism for logging messages to multiple loggers. You define and add (register) one or more loggers to the PTLogFactory. This allows you to define multiple loggers with custom implementations, such as a console logger, web logger, or console history logger.

The PSDK generates log messages for many of its activities, which the PTLogFactory forwards to all registered loggers. In addition, your application can generate custom log messages, which are also forwarded to all registered loggers. Each logger can then filter the messages in any way that you choose and take appropriate action.

There are two implementations for PTLogFactory. One is for listening to logs and the second one is for adding logs to a PTLogFactory.