diff options
author | Martin Szulecki | 2010-01-12 19:09:36 +0100 |
---|---|---|
committer | Martin Szulecki | 2010-01-12 19:09:36 +0100 |
commit | 342f4e929888c0aaa088e39fb98a74957bf45fa7 (patch) | |
tree | 905bafb1b353b8ac21e3fb1f9c773d218a5c878e /src/device_link_service.c | |
parent | bf3dc421b2b5ccfe2fcd3cd4ec1ef90f39599600 (diff) | |
download | libimobiledevice-342f4e929888c0aaa088e39fb98a74957bf45fa7.tar.gz libimobiledevice-342f4e929888c0aaa088e39fb98a74957bf45fa7.tar.bz2 |
Refactor and unify internal debug system for ease of use and verbosity
This introduces a new debug_info macro which automatically prints
the calling function, file and line number information instead of
having that information passed to every old log_debug_msg call.
Diffstat (limited to 'src/device_link_service.c')
-rw-r--r-- | src/device_link_service.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/device_link_service.c b/src/device_link_service.c index b1106fe..e1155a5 100644 --- a/src/device_link_service.c +++ b/src/device_link_service.c @@ -149,13 +149,13 @@ device_link_service_error_t device_link_service_version_exchange(device_link_ser /* receive DLMessageVersionExchange from device */ if (property_list_service_receive_plist(client->parent, &array) != PROPERTY_LIST_SERVICE_E_SUCCESS) { - log_debug_msg("%s: Did not receive initial message from device!\n", __func__); + debug_info("Did not receive initial message from device!"); err = DEVICE_LINK_SERVICE_E_MUX_ERROR; goto leave; } msg = device_link_service_get_message(array); if (!msg || strcmp(msg, "DLMessageVersionExchange")) { - log_debug_msg("%s: Did not receive DLMessageVersionExchange from device!\n", __func__); + debug_info("Did not receive DLMessageVersionExchange from device!"); err = DEVICE_LINK_SERVICE_E_PLIST_ERROR; goto leave; } @@ -164,7 +164,7 @@ device_link_service_error_t device_link_service_version_exchange(device_link_ser /* get major and minor version number */ if (plist_array_get_size(array) < 3) { - log_debug_msg("%s: DLMessageVersionExchange has unexpected format!\n", __func__); + debug_info("DLMessageVersionExchange has unexpected format!"); err = DEVICE_LINK_SERVICE_E_PLIST_ERROR; goto leave; } @@ -179,11 +179,11 @@ device_link_service_error_t device_link_service_version_exchange(device_link_ser plist_get_uint_val(min, &vminor); } if (vmajor > version_major) { - log_debug_msg("%s: Version mismatch: device=(%lld,%lld) > expected=(%lld,%lld)\n", __func__, vmajor, vminor, version_major, version_minor); + debug_info("Version mismatch: device=(%lld,%lld) > expected=(%lld,%lld)", vmajor, vminor, version_major, version_minor); err = DEVICE_LINK_SERVICE_E_BAD_VERSION; goto leave; } else if ((vmajor == version_major) && (vminor > version_minor)) { - log_debug_msg("%s: WARNING: Version mismatch: device=(%lld,%lld) > expected=(%lld,%lld)\n", __func__, vmajor, vminor, version_major, version_minor); + debug_info("WARNING: Version mismatch: device=(%lld,%lld) > expected=(%lld,%lld)", vmajor, vminor, version_major, version_minor); err = DEVICE_LINK_SERVICE_E_BAD_VERSION; goto leave; } @@ -194,7 +194,7 @@ device_link_service_error_t device_link_service_version_exchange(device_link_ser plist_array_append_item(array, plist_new_string("DLMessageVersionExchange")); plist_array_append_item(array, plist_new_string("DLVersionsOk")); if (property_list_service_send_binary_plist(client->parent, array) != PROPERTY_LIST_SERVICE_E_SUCCESS) { - log_debug_msg("%s: Error when sending DLVersionsOk", __func__); + debug_info("Error when sending DLVersionsOk"); err = DEVICE_LINK_SERVICE_E_MUX_ERROR; goto leave; } @@ -203,13 +203,13 @@ device_link_service_error_t device_link_service_version_exchange(device_link_ser /* receive DeviceReady message */ array = NULL; if (property_list_service_receive_plist(client->parent, &array) != PROPERTY_LIST_SERVICE_E_SUCCESS) { - log_debug_msg("%s: Error when receiving DLMessageDeviceReady!\n", __func__); + debug_info("Error when receiving DLMessageDeviceReady!"); err = DEVICE_LINK_SERVICE_E_MUX_ERROR; goto leave; } msg = device_link_service_get_message(array); if (!msg || strcmp(msg, "DLMessageDeviceReady")) { - log_debug_msg("%s: Did not get DLMessageDeviceReady!\n", __func__); + debug_info("Did not get DLMessageDeviceReady!"); err = DEVICE_LINK_SERVICE_E_PLIST_ERROR; goto leave; } |