aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-03-08 01:28:28 -0300
committerdequis <dx@dxzone.com.ar>2015-04-10 14:10:40 -0300
commit693aca0fc7edd7e9babe4de8e399d44fa273660a (patch)
tree826a08515cbff68b85c5c410b2415d618d77a98c
parenta9b1e0edf0280371772e346ee96d24f732bef59f (diff)
msn: colorful debug
-rw-r--r--protocols/msn/msn_util.c4
-rw-r--r--protocols/msn/ns.c2
-rw-r--r--protocols/msn/soap.c2
3 files changed, 6 insertions, 2 deletions
diff --git a/protocols/msn/msn_util.c b/protocols/msn/msn_util.c
index 5164a8d2..e4c7aa61 100644
--- a/protocols/msn/msn_util.c
+++ b/protocols/msn/msn_util.c
@@ -274,12 +274,14 @@ int msn_handler(struct msn_handler_data *h)
h->rxlen += st;
if (st <= 0) {
+ fprintf(stderr, "\n\x1b[92m<<< [closed]\x1b[97m ");
return(-1);
}
if (getenv("BITLBEE_DEBUG")) {
- write(2, "->C:", 4);
+ fprintf(stderr, "\n\x1b[92m<<< ");
write(2, h->rxq + h->rxlen - st, st);
+ fprintf(stderr, "\x1b[97m");
}
while (st) {
diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c
index 02abc52c..d3c9b87a 100644
--- a/protocols/msn/ns.c
+++ b/protocols/msn/ns.c
@@ -57,7 +57,7 @@ int msn_ns_write(struct im_connection *ic, int fd, const char *fmt, ...)
}
if (getenv("BITLBEE_DEBUG")) {
- fprintf(stderr, "->NS%d:%s\n", fd, out);
+ fprintf(stderr, "\x1b[91m>>>[NS%d] %s\n\x1b[97m", fd, out);
}
len = strlen(out);
diff --git a/protocols/msn/soap.c b/protocols/msn/soap.c
index f948decb..7d1bed1f 100644
--- a/protocols/msn/soap.c
+++ b/protocols/msn/soap.c
@@ -208,6 +208,7 @@ static void msn_soap_debug_print(const char *headers, const char *payload)
if (!getenv("BITLBEE_DEBUG")) {
return;
}
+ fprintf(stderr, "\n\x1b[90mSOAP:\n");
if (headers) {
if ((s = strstr(headers, "\r\n\r\n"))) {
@@ -224,6 +225,7 @@ static void msn_soap_debug_print(const char *headers, const char *payload)
}
xt_free_node(xt);
}
+ fprintf(stderr, "\n\x1b[97m\n");
}
int msn_soapq_flush(struct im_connection *ic, gboolean resend)