summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Greg Dennis2018-03-29 23:43:21 -0400
committerGravatar Nikias Bassen2020-02-20 02:40:55 +0100
commit505e84f7f6ad41e751488309e67d2e8e45c2ec97 (patch)
tree5430f712a13f2771fe504c58a9080ed06c2c0f9d
parentce0868cd7c6c037b70bf5329fd5e8d0d5100576f (diff)
downloadlibimobiledevice-505e84f7f6ad41e751488309e67d2e8e45c2ec97.tar.gz
libimobiledevice-505e84f7f6ad41e751488309e67d2e8e45c2ec97.tar.bz2
Update debug.c to consistently output to stderr
This makes debug_print_line consistent with debug_buffer and among other things, ensures output from `idevicedebug run` can be easily divided into output from the app itself (stdout) from debug output from libimobiledevice (stderr).
-rw-r--r--common/debug.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/common/debug.c b/common/debug.c
index acca456..a1c336b 100644
--- a/common/debug.c
+++ b/common/debug.c
@@ -66,13 +66,10 @@ static void debug_print_line(const char *func, const char *file, int line, const
/* trim ending newlines */
/* print header */
- printf ("%s: ", header);
+ fprintf(stderr, "%s: ", header);
/* print actual debug content */
- printf ("%s\n", buffer);
-
- /* flush this output, as we need to debug */
- fflush (stdout);
+ fprintf(stderr, "%s\n", buffer);
free (header);
}