summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2025-02-13 03:40:03 +0100
committerGravatar Nikias Bassen2025-02-13 03:40:03 +0100
commit5c9f8d6bc16a9a853d91baabe4d39882ac834621 (patch)
tree0f166b1facdb032f237c77ed18b7ab939af9bff9
parentbf9d739380242f75e58dc3d6db41266d4e766c2d (diff)
downloadlibimobiledevice-glue-5c9f8d6bc16a9a853d91baabe4d39882ac834621.tar.gz
libimobiledevice-glue-5c9f8d6bc16a9a853d91baabe4d39882ac834621.tar.bz2
socket: Allow setting debug level via environment variable
The value of SOCKET_DEBUG is read once during initialization (library constructor) and is expected to be a numerical value.
-rw-r--r--src/socket.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/socket.c b/src/socket.c
index 1d59faf..6b4e219 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -104,6 +104,10 @@ void socket_init(void)
ExitProcess(1);
}
#endif
+ char *env_debug = getenv("SOCKET_DEBUG");
+ if (env_debug) {
+ verbose = (int)strtol(env_debug, NULL, 10);
+ }
}
void socket_set_verbose(int level)