[gnome-software/wip/ubuntu-xenial] Log snapd requests and responses if GNOME_SOFTWARE_SNAPPY is debug
- From: William Hua <williamhua src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/ubuntu-xenial] Log snapd requests and responses if GNOME_SOFTWARE_SNAPPY is debug
- Date: Mon, 25 Apr 2016 12:19:25 +0000 (UTC)
commit 62859e3296c5f38252555dc045724958e8307dec
Author: William Hua <william hua canonical com>
Date: Mon Apr 25 14:18:41 2016 +0200
Log snapd requests and responses if GNOME_SOFTWARE_SNAPPY is debug
src/plugins/gs-ubuntu-snapd.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-ubuntu-snapd.c b/src/plugins/gs-ubuntu-snapd.c
index ec68b7f..c80d87c 100644
--- a/src/plugins/gs-ubuntu-snapd.c
+++ b/src/plugins/gs-ubuntu-snapd.c
@@ -134,6 +134,9 @@ send_snapd_request (const gchar *method,
if (content)
g_string_append (request, content);
+ if (g_strcmp0 (g_getenv ("GNOME_SOFTWARE_SNAPPY"), "debug") == 0)
+ g_print ("===== begin snapd request =====\n%s\n===== end snapd request =====\n",
request->str);
+
/* Send HTTP request */
n_written = g_socket_send (socket, request->str, request->len, NULL, error);
if (n_written < 0)
@@ -263,6 +266,9 @@ send_snapd_request (const gchar *method,
*response = g_malloc (chunk_length + 2);
memcpy (*response, chunk_start, chunk_length + 1);
(*response)[chunk_length + 1] = '\0';
+
+ if (g_strcmp0 (g_getenv ("GNOME_SOFTWARE_SNAPPY"), "debug") == 0)
+ g_info ("===== begin snapd response =====\nStatus %u\n%s\n===== end snapd response
=====\n", code, *response);
}
if (response_length)
*response_length = chunk_length;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]