Add logging functionality to PubSub. Enable with PubSub.log()