void CC_CapsPrinter::onDeviceEvent (ccapi_device_event_e deviceEvent, CC_DevicePtr device, CC_DeviceInfoPtr info ) { base::AutoLock lock(eventPrinterMutex); printHeaderBlockIfNotAlreadyPrinted(); CSFLogDebugS(logTag, "D:"); printCurrentThreadID(); std::string eventNameStr = truncateLeft(device_event_getname(deviceEvent), EVENT_NAME_FIELD_WIDTH); CSFLogDebug(logTag, "%*s %s ", EVENT_NAME_FIELD_WIDTH, eventNameStr.c_str(), device->toString().c_str()); switch (deviceEvent) { case CCAPI_DEVICE_EV_STATE: PRINT_EVENT_INFO_NICELY_USING_GETNAME("ServiceState", info, getServiceState, service_state_getname); break; case CCAPI_DEVICE_EV_SERVER_STATUS: { vector<CC_CallServerInfoPtr> callServers = info->getCallServers(); for (size_t i=0; i<callServers.size(); i++) { CSFLogDebug(logTag, "%*s(CallServer %lu: ", WRAPPED_LINE_ALIGNMENT_OFFSET_1, "", (unsigned long) i); CSFLogDebugS(logTag, "----------"); CC_CallServerInfoPtr callServerInfoPtr = callServers[i]; PRINT_EVENT_INFO_NICELY_USING_GETNAME("CallServerMode", callServerInfoPtr, getCallServerMode, cucm_mode_getname); PRINT_OFFSET_2; PRINT_EVENT_INFO_NICELY_USING_GETNAME("CallServerStatus", callServerInfoPtr, getCallServerStatus, ccm_status_getname); } break; } default: break; }//end switch }
void CC_CapsPrinter::onFeatureEvent (ccapi_device_event_e deviceEvent, CC_DevicePtr device, CC_FeatureInfoPtr feature_info) { base::AutoLock lock(eventPrinterMutex); printHeaderBlockIfNotAlreadyPrinted(); CSFLogDebugS(logTag, "F:"); printCurrentThreadID(); CSFLogDebug(logTag, "%*s %s ", EVENT_NAME_FIELD_WIDTH, device_event_getname(deviceEvent), device->toString().c_str()); }