@commercetools/sdk-middleware-logger
Advanced tools
Comparing version 1.0.4 to 1.0.5
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(factory((global.CommercetoolsSdkMiddlewareLogger = {}))); | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(factory((global.CommercetoolsSdkMiddlewareLogger = {}))); | ||
}(this, (function (exports) { 'use strict'; | ||
/* */ | ||
/* */ | ||
function createLoggerMiddleware() { | ||
return function (next) { | ||
return function (request, response) { | ||
var error = response.error, | ||
body = response.body, | ||
statusCode = response.statusCode; | ||
function createLoggerMiddleware() { | ||
return function (next) { | ||
return function (request, response) { | ||
var error = response.error, | ||
body = response.body, | ||
statusCode = response.statusCode; | ||
console.log('Request: ', request); | ||
console.log('Response: ', { error: error, body: body, statusCode: statusCode }); | ||
next(request, response); | ||
console.log('Request: ', request); | ||
console.log('Response: ', { error: error, body: body, statusCode: statusCode }); | ||
next(request, response); | ||
}; | ||
}; | ||
}; | ||
} | ||
} | ||
// eslint-disable-next-line import/prefer-default-export | ||
// eslint-disable-next-line import/prefer-default-export | ||
exports.createLoggerMiddleware = createLoggerMiddleware; | ||
exports.createLoggerMiddleware = createLoggerMiddleware; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
}))); | ||
//# sourceMappingURL=commercetools-sdk-middleware-logger.umd.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o(e.CommercetoolsSdkMiddlewareLogger={})}(this,function(e){"use strict";e.createLoggerMiddleware=function(){return function(e){return function(o,t){var n=t.error,r=t.body,d=t.statusCode;console.log("Request: ",o),console.log("Response: ",{error:n,body:r,statusCode:d}),e(o,t)}}},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o(e.CommercetoolsSdkMiddlewareLogger={})}(this,function(e){"use strict";e.createLoggerMiddleware=function(){return function(d){return function(e,o){var t=o.error,n=o.body,r=o.statusCode;console.log("Request: ",e),console.log("Response: ",{error:t,body:n,statusCode:r}),d(e,o)}}},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=commercetools-sdk-middleware-logger.umd.min.js.map |
@@ -7,3 +7,3 @@ { | ||
"name": "@commercetools/sdk-middleware-logger", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Middleware for logging request and response being executed, to use with @commercetools/sdk-client", | ||
@@ -10,0 +10,0 @@ "keywords": [ |
5397
10
60