Add debug logging to CPM.