Change http logging

Printing method + url again makes it easier to match requests to
responses when scanning logs.

// FREEBIE
This commit is contained in:
lilia 2015-09-30 11:17:19 -07:00
parent 0f8aff12c5
commit 37ff3cf5a8
2 changed files with 6 additions and 6 deletions

View file

@ -38962,15 +38962,15 @@ TextSecureServer = function () {
try { result = JSON.parse(xhr.responseText + ''); } catch(e) {} try { result = JSON.parse(xhr.responseText + ''); } catch(e) {}
} }
if ( 0 <= xhr.status && xhr.status < 400) { 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); resolve(result, xhr.status);
} else { } else {
console.log('Error', xhr.status, url); console.log(options.type, url, xhr.status, 'Error');
reject(HTTPError(xhr.status, result, error.stack)); reject(HTTPError(xhr.status, result, error.stack));
} }
}; };
xhr.onerror = function() { xhr.onerror = function() {
console.log('Error', xhr.status, url); console.log(options.type, url, xhr.status, 'Error');
reject(HTTPError(xhr.status, null, error.stack)); reject(HTTPError(xhr.status, null, error.stack));
}; };
xhr.send( options.data || null ); xhr.send( options.data || null );

View file

@ -65,15 +65,15 @@ TextSecureServer = function () {
try { result = JSON.parse(xhr.responseText + ''); } catch(e) {} try { result = JSON.parse(xhr.responseText + ''); } catch(e) {}
} }
if ( 0 <= xhr.status && xhr.status < 400) { 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); resolve(result, xhr.status);
} else { } else {
console.log('Error', xhr.status, url); console.log(options.type, url, xhr.status, 'Error');
reject(HTTPError(xhr.status, result, error.stack)); reject(HTTPError(xhr.status, result, error.stack));
} }
}; };
xhr.onerror = function() { xhr.onerror = function() {
console.log('Error', xhr.status, url); console.log(options.type, url, xhr.status, 'Error');
reject(HTTPError(xhr.status, null, error.stack)); reject(HTTPError(xhr.status, null, error.stack));
}; };
xhr.send( options.data || null ); xhr.send( options.data || null );