diff options
| author | 2010-01-12 19:09:36 +0100 | |
|---|---|---|
| committer | 2010-01-12 19:09:36 +0100 | |
| commit | 342f4e929888c0aaa088e39fb98a74957bf45fa7 (patch) | |
| tree | 905bafb1b353b8ac21e3fb1f9c773d218a5c878e /src/SBServices.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/SBServices.c')
| -rw-r--r-- | src/SBServices.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/SBServices.c b/src/SBServices.c index 2b65785..9589ec2 100644 --- a/src/SBServices.c +++ b/src/SBServices.c | |||
| @@ -35,7 +35,7 @@ | |||
| 35 | */ | 35 | */ |
| 36 | static void sbs_lock(sbservices_client_t client) | 36 | static void sbs_lock(sbservices_client_t client) |
| 37 | { | 37 | { |
| 38 | log_debug_msg("SBServices: Locked\n"); | 38 | debug_info("SBServices: Locked"); |
| 39 | g_mutex_lock(client->mutex); | 39 | g_mutex_lock(client->mutex); |
| 40 | } | 40 | } |
| 41 | 41 | ||
| @@ -45,7 +45,7 @@ static void sbs_lock(sbservices_client_t client) | |||
| 45 | */ | 45 | */ |
| 46 | static void sbs_unlock(sbservices_client_t client) | 46 | static void sbs_unlock(sbservices_client_t client) |
| 47 | { | 47 | { |
| 48 | log_debug_msg("SBServices: Unlocked\n"); | 48 | debug_info("SBServices: Unlocked"); |
| 49 | g_mutex_unlock(client->mutex); | 49 | g_mutex_unlock(client->mutex); |
| 50 | } | 50 | } |
| 51 | 51 | ||
| @@ -99,7 +99,7 @@ sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t | |||
| 99 | sbs_lock(client); | 99 | sbs_lock(client); |
| 100 | 100 | ||
| 101 | if (property_list_service_send_binary_plist(client->parent, dict) != PROPERTY_LIST_SERVICE_E_SUCCESS) { | 101 | if (property_list_service_send_binary_plist(client->parent, dict) != PROPERTY_LIST_SERVICE_E_SUCCESS) { |
| 102 | log_debug_msg("%s: could not send plist\n", __func__); | 102 | debug_info("could not send plist"); |
| 103 | goto leave_unlock; | 103 | goto leave_unlock; |
| 104 | } | 104 | } |
| 105 | plist_free(dict); | 105 | plist_free(dict); |
| @@ -108,7 +108,7 @@ sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t | |||
| 108 | if (property_list_service_receive_plist(client->parent, state) == PROPERTY_LIST_SERVICE_E_SUCCESS) { | 108 | if (property_list_service_receive_plist(client->parent, state) == PROPERTY_LIST_SERVICE_E_SUCCESS) { |
| 109 | res = SBSERVICES_E_SUCCESS; | 109 | res = SBSERVICES_E_SUCCESS; |
| 110 | } else { | 110 | } else { |
| 111 | log_debug_msg("%s: could not get icon state!\n", __func__); | 111 | debug_info("could not get icon state!"); |
| 112 | if (*state) { | 112 | if (*state) { |
| 113 | plist_free(*state); | 113 | plist_free(*state); |
| 114 | *state = NULL; | 114 | *state = NULL; |
| @@ -137,7 +137,7 @@ sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist_t | |||
| 137 | sbs_lock(client); | 137 | sbs_lock(client); |
| 138 | 138 | ||
| 139 | if (property_list_service_send_binary_plist(client->parent, dict) != IPHONE_E_SUCCESS) { | 139 | if (property_list_service_send_binary_plist(client->parent, dict) != IPHONE_E_SUCCESS) { |
| 140 | log_debug_msg("%s: could not send plist\n", __func__); | 140 | debug_info("could not send plist"); |
| 141 | goto leave_unlock; | 141 | goto leave_unlock; |
| 142 | } | 142 | } |
| 143 | // NO RESPONSE | 143 | // NO RESPONSE |
| @@ -164,7 +164,7 @@ sbservices_error_t sbservices_get_icon_pngdata(sbservices_client_t client, const | |||
| 164 | sbs_lock(client); | 164 | sbs_lock(client); |
| 165 | 165 | ||
| 166 | if (property_list_service_send_binary_plist(client->parent, dict) != PROPERTY_LIST_SERVICE_E_SUCCESS) { | 166 | if (property_list_service_send_binary_plist(client->parent, dict) != PROPERTY_LIST_SERVICE_E_SUCCESS) { |
| 167 | log_debug_msg("%s: could not send plist\n", __func__); | 167 | debug_info("could not send plist"); |
| 168 | goto leave_unlock; | 168 | goto leave_unlock; |
| 169 | } | 169 | } |
| 170 | plist_free(dict); | 170 | plist_free(dict); |
