logging storage requests

This commit is contained in:
antelle 2020-03-22 20:58:29 +01:00
parent e9b05fe345
commit 5ac4b42452
1 changed files with 2 additions and 0 deletions

View File

@ -42,6 +42,7 @@ class StorageBase {
} }
_xhr(config) { _xhr(config) {
this.logger.info('HTTP request', config.method || 'GET', config.url);
if (config.data) { if (config.data) {
if (!config.dataType) { if (!config.dataType) {
config.dataType = 'application/octet-stream'; config.dataType = 'application/octet-stream';
@ -58,6 +59,7 @@ class StorageBase {
}; };
} }
this._httpRequest(config, response => { this._httpRequest(config, response => {
this.logger.info('HTTP response', response.status);
const statuses = config.statuses || [200]; const statuses = config.statuses || [200];
if (statuses.indexOf(response.status) >= 0) { if (statuses.indexOf(response.status) >= 0) {
return config.success && config.success(response.response, response); return config.success && config.success(response.response, response);