From 503bdd01f5e9f16c583ebff343edee8bfaf3f572 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sat, 7 Oct 2023 02:33:03 +0200 Subject: Improve debug output by suppressing libimobiledevice and libirecovery debug output by default To get libimobiledevice and libirecovery output, add -d or --debug twice. --- src/common.h | 1 + src/idevicerestore.c | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/common.h b/src/common.h index 5afe5ab..6708943 100644 --- a/src/common.h +++ b/src/common.h @@ -91,6 +91,7 @@ struct idevicerestore_entry_t { struct idevicerestore_client_t { int flags; + int debug_level; plist_t tss; plist_t tss_localpolicy; plist_t tss_recoveryos_root_ticket; diff --git a/src/idevicerestore.c b/src/idevicerestore.c index 7b69a9f..56207a0 100644 --- a/src/idevicerestore.c +++ b/src/idevicerestore.c @@ -341,10 +341,12 @@ int idevicerestore_start(struct idevicerestore_client_t* client) return -1; } - if (client->flags & FLAG_DEBUG) { - idevice_set_debug_level(1); - irecv_set_debug_level(1); + if (client->debug_level > 0) { idevicerestore_debug = 1; + if (client->debug_level > 1) { + idevice_set_debug_level(1); + irecv_set_debug_level(1); + } } idevicerestore_progress(client, RESTORE_STEP_DETECT, 0.0); @@ -1483,6 +1485,7 @@ int main(int argc, char* argv[]) { case 'd': client->flags |= FLAG_DEBUG; + client->debug_level++; break; case 'e': -- cgit v1.1-32-gdbae