From 37ff3cf5a8902a38c01e7501c5224ad9f6135920 Mon Sep 17 00:00:00 2001 From: lilia Date: Wed, 30 Sep 2015 11:17:19 -0700 Subject: [PATCH] Change http logging Printing method + url again makes it easier to match requests to responses when scanning logs. // FREEBIE --- js/libtextsecure.js | 6 +++--- libtextsecure/api.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js/libtextsecure.js b/js/libtextsecure.js index 541096718..f2be1d2a1 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -38962,15 +38962,15 @@ TextSecureServer = function () { try { result = JSON.parse(xhr.responseText + ''); } catch(e) {} } if ( 0 <= xhr.status && xhr.status < 400) { - console.log('Success', xhr.status, url); + console.log(options.type, url, xhr.status, 'Success'); resolve(result, xhr.status); } else { - console.log('Error', xhr.status, url); + console.log(options.type, url, xhr.status, 'Error'); reject(HTTPError(xhr.status, result, error.stack)); } }; xhr.onerror = function() { - console.log('Error', xhr.status, url); + console.log(options.type, url, xhr.status, 'Error'); reject(HTTPError(xhr.status, null, error.stack)); }; xhr.send( options.data || null ); diff --git a/libtextsecure/api.js b/libtextsecure/api.js index 3b38a282d..081eb63c1 100644 --- a/libtextsecure/api.js +++ b/libtextsecure/api.js @@ -65,15 +65,15 @@ TextSecureServer = function () { try { result = JSON.parse(xhr.responseText + ''); } catch(e) {} } if ( 0 <= xhr.status && xhr.status < 400) { - console.log('Success', xhr.status, url); + console.log(options.type, url, xhr.status, 'Success'); resolve(result, xhr.status); } else { - console.log('Error', xhr.status, url); + console.log(options.type, url, xhr.status, 'Error'); reject(HTTPError(xhr.status, result, error.stack)); } }; xhr.onerror = function() { - console.log('Error', xhr.status, url); + console.log(options.type, url, xhr.status, 'Error'); reject(HTTPError(xhr.status, null, error.stack)); }; xhr.send( options.data || null );