chiark / gitweb /
journal-upload: enable curl debug output conditionally
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 6 Jan 2015 05:26:26 +0000 (00:26 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 6 Jan 2015 05:26:26 +0000 (00:26 -0500)
https://bugs.freedesktop.org/show_bug.cgi?id=86464

src/journal-remote/journal-upload.c

index 5b25da5..50332ed 100644 (file)
@@ -236,8 +236,9 @@ int start_upload(Uploader *u,
                 easy_setopt(curl, CURLOPT_HTTPHEADER, u->header,
                             LOG_ERR, return -EXFULL);
 
-                /* enable verbose for easier tracing */
-                easy_setopt(curl, CURLOPT_VERBOSE, 1L, LOG_WARNING, );
+                if (_unlikely_(log_get_max_level() >= LOG_DEBUG))
+                        /* enable verbose for easier tracing */
+                        easy_setopt(curl, CURLOPT_VERBOSE, 1L, LOG_WARNING, );
 
                 easy_setopt(curl, CURLOPT_USERAGENT,
                             "systemd-journal-upload " PACKAGE_STRING,