axios-logger
Advanced tools
Comparing version 2.4.0 to 2.5.0
# Change Log | ||
## 2.5.0 | ||
- Enriched README with more information on how to specify the logger function to be used. (#66) | ||
- Add log config into error logger with a promise (#72) (#73) | ||
- Customizing logger function doesn't work, always uses global config logger (#75) (#76) | ||
- Remove lib folder (#77) (#78) | ||
- logger is a required but not actually used (#71) | ||
## 2.4.0 | ||
- Support more loggers (#53) (#62) | ||
- Placing HTTP method first, then the URL (#60) (#63) | ||
- Allow for no timestamp being appended (#64) | ||
- Explicitly set defaults in the code, as documented (#65) | ||
## 2.3.1 | ||
@@ -4,0 +19,0 @@ |
import { ErrorLogConfig, GlobalLogConfig, RequestLogConfig, ResponseLogConfig } from './types'; | ||
declare function getGlobalConfig(): GlobalLogConfig; | ||
declare function getGlobalConfig(): Required<GlobalLogConfig>; | ||
declare function setGlobalConfig(config: GlobalLogConfig): void; | ||
declare function assembleBuildConfig(config?: RequestLogConfig | ResponseLogConfig | ErrorLogConfig): { | ||
data?: boolean | undefined; | ||
method?: boolean | undefined; | ||
url?: boolean | undefined; | ||
status?: boolean | undefined; | ||
statusText?: boolean | undefined; | ||
code?: boolean | undefined; | ||
prefixText?: string | boolean | undefined; | ||
dateFormat?: string | boolean | undefined; | ||
headers?: boolean | undefined; | ||
logger: (text: string) => any; | ||
} | { | ||
data?: boolean | undefined; | ||
method?: boolean | undefined; | ||
url?: boolean | undefined; | ||
prefixText?: string | boolean | undefined; | ||
dateFormat?: string | boolean | undefined; | ||
headers?: boolean | undefined; | ||
logger: (text: string) => any; | ||
status?: boolean | undefined; | ||
statusText?: boolean | undefined; | ||
code?: boolean | undefined; | ||
} | { | ||
data?: boolean | undefined; | ||
status?: boolean | undefined; | ||
statusText?: boolean | undefined; | ||
prefixText?: string | boolean | undefined; | ||
dateFormat?: string | boolean | undefined; | ||
headers?: boolean | undefined; | ||
logger: (text: string) => any; | ||
method?: boolean | undefined; | ||
url?: boolean | undefined; | ||
code?: boolean | undefined; | ||
} | { | ||
data?: boolean | undefined; | ||
code?: boolean | undefined; | ||
prefixText?: string | boolean | undefined; | ||
dateFormat?: string | boolean | undefined; | ||
headers?: boolean | undefined; | ||
logger: (text: string) => any; | ||
method?: boolean | undefined; | ||
url?: boolean | undefined; | ||
status?: boolean | undefined; | ||
statusText?: boolean | undefined; | ||
}; | ||
declare function assembleBuildConfig(config: RequestLogConfig | ResponseLogConfig | ErrorLogConfig): Required<GlobalLogConfig>; | ||
export { getGlobalConfig, setGlobalConfig, assembleBuildConfig, }; |
@@ -21,2 +21,3 @@ "use strict"; | ||
status: true, | ||
statusText: true, | ||
logger: console.log, | ||
@@ -33,8 +34,8 @@ prefixText: 'Axios', | ||
function setGlobalConfig(config) { | ||
globalConfig = _objectSpread({}, globalConfig, {}, config); | ||
globalConfig = _objectSpread(_objectSpread({}, globalConfig), config); | ||
} | ||
function assembleBuildConfig(config) { | ||
return _objectSpread({}, globalConfig, {}, config); | ||
return _objectSpread(_objectSpread({}, globalConfig), config); | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tb24vY29uZmlnLnRzIl0sIm5hbWVzIjpbImdsb2JhbENvbmZpZyIsIm1ldGhvZCIsInVybCIsImRhdGEiLCJzdGF0dXMiLCJsb2dnZXIiLCJjb25zb2xlIiwibG9nIiwicHJlZml4VGV4dCIsImRhdGVGb3JtYXQiLCJoZWFkZXJzIiwiZ2V0R2xvYmFsQ29uZmlnIiwic2V0R2xvYmFsQ29uZmlnIiwiY29uZmlnIiwiYXNzZW1ibGVCdWlsZENvbmZpZyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7O0FBRUEsSUFBSUEsWUFBNkIsR0FBRztBQUNoQ0MsRUFBQUEsTUFBTSxFQUFFLElBRHdCO0FBRWhDQyxFQUFBQSxHQUFHLEVBQUUsSUFGMkI7QUFHaENDLEVBQUFBLElBQUksRUFBRSxJQUgwQjtBQU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Mb2dDb25maWcpIHtcbiAgICBnbG9iYWxDb25maWcgPSB7XG4gICAgICAgIC4uLmdsb2JhbENvbmZpZyxcbiAgICAgICAgLi4uY29uZmlnLFxuICAgIH07XG59XG5cbmZ1bmN0aW9uIGFzc2VtYmxlQnVpbGRDb25maWcoY29uZmlnPzogUmVxdWVzdExvZ0NvbmZpZyB8IFJlc3BvbnNlTG9nQ29uZmlnIHwgRXJyb3JMb2dDb25maWcpIHtcbiAgICByZXR1cm4ge1xuICAgICAgICAuLi5nbG9iYWxDb25maWcsXG4gICAgICAgIC4uLmNvbmZpZyxcbiAgICB9O1xufVxuXG5leHBvcnQge1xuICAgIGdldEdsb2JhbENvbmZpZyxcbiAgICBzZXRHbG9iYWxDb25maWcsXG4gICAgYXNzZW1ibGVCdWlsZENvbmZpZyxcbn07XG4iXX0= | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tb24vY29uZmlnLnRzIl0sIm5hbWVzIjpbImdsb2JhbENvbmZpZyIsIm1ldGhvZCIsInVybCIsImRhdGEiLCJzdGF0dXMiLCJzdGF0dXNUZXh0IiwibG9nZ2VyIiwiY29uc29sZSIsImxvZyIsInByZWZpeFRleHQiLCJkYXRlRm9ybWF0IiwiaGVhZGVycyIsImdldEdsb2JhbENvbmZpZyIsInNldEdsb2JhbENvbmZpZyIsImNvbmZpZyIsImFzc2VtYmxlQnVpbGRDb25maWciXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7OztBQUVBLElBQUlBLFlBQXVDLEdBQUc7QUFDMUNDLEVBQUFBLE1BQU0sRUFBRSxJQURrQztBQUUxQ0MsRUFBQUEsR0FBRyxFQUFFLElBRnFDO0FBRzFDQyxFQUFBQSxJQUFJLEVBQUUsSUFIb0M7QUFJMUNDLEVBQUFBLE1BQU0sRUFBRSxJQUprQztBQUsxQ0MsRUFBQUEsVUFBVSxFQUFFLElBTDhC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OiBHbG9iYWxMb2dDb25maWcpIHtcbiAgICBnbG9iYWxDb25maWcgPSB7XG4gICAgICAgIC4uLmdsb2JhbENvbmZpZyxcbiAgICAgICAgLi4uY29uZmlnLFxuICAgIH07XG59XG5cbmZ1bmN0aW9uIGFzc2VtYmxlQnVpbGRDb25maWcoY29uZmlnOiBSZXF1ZXN0TG9nQ29uZmlnIHwgUmVzcG9uc2VMb2dDb25maWcgfCBFcnJvckxvZ0NvbmZpZyk6IFJlcXVpcmVkPEdsb2JhbExvZ0NvbmZpZz4ge1xuICAgIHJldHVybiB7XG4gICAgICAgIC4uLmdsb2JhbENvbmZpZyxcbiAgICAgICAgLi4uY29uZmlnLFxuICAgIH07XG59XG5cbmV4cG9ydCB7XG4gICAgZ2V0R2xvYmFsQ29uZmlnLFxuICAgIHNldEdsb2JhbENvbmZpZyxcbiAgICBhc3NlbWJsZUJ1aWxkQ29uZmlnLFxufTtcbiJdfQ== |
@@ -78,3 +78,3 @@ "use strict"; | ||
makeStatus(status, statusText) { | ||
if (status && statusText) this.printQueue.push(`${status}:${statusText}`); | ||
if (this.config.status && this.config.statusText && status && statusText) this.printQueue.push(`${status}:${statusText}`);else if (this.config.status && status) this.printQueue.push(`${status}`);else if (this.config.statusText && statusText) this.printQueue.push(statusText); | ||
return this; | ||
@@ -91,2 +91,2 @@ } | ||
exports.default = _default; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tb24vc3RyaW5nLWJ1aWxkZXIudHMiXSwibmFtZXMiOlsiU3RyaW5nQnVpbGRlciIsImNvbnN0cnVjdG9yIiwiY29uZmlnIiwicHJpbnRRdWV1ZSIsImZpbHRlcmVkSGVhZGVyTGlzdCIsIm1ha2VMb2dUeXBlV2l0aFByZWZpeCIsImxvZ1R5cGUiLCJwcmVmaXgiLCJwcmVmaXhUZXh0IiwicHVzaCIsImNoYWxrIiwiZ3JlZW4iLCJtYW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GQgdGhpcylcbiAgICAgICAgaWYgKHRoaXMuY29uZmlnLmRhdGVGb3JtYXQgIT09IGZhbHNlKSB7XG4gICAgICAgICAgICAvLyBAdHMtaWdub3JlXG4gICAgICAgICAgICBjb25zdCBkYXRlRm9ybWF0ID0gZGF0ZWZvcm1hdChkYXRlLCB0aGlzLmNvbmZpZy5kYXRlRm9ybWF0IHx8ICdpc29EYXRlVGltZScpO1xuICAgICAgICAgICAgdGhpcy5wcmludFF1ZXVlLnB1c2goZGF0ZUZvcm1hdCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgbWFrZUhlYWRlcihoZWFkZXJzPzogeyBba2V5OnN0cmluZ10gOiB7dmFsdWU6c3RyaW5nfX0pIHtcbiAgICAgICAgaWYodGhpcy5jb25maWcuaGVhZGVycyAmJiBoZWFkZXJzKSB7XG4gICAgICAgICAgICBjb25zdCBoZWFkZXJNYXA6eyBba2V5OnN0cmluZ10gOiB7dmFsdWU6c3RyaW5nfX0gPSB7fTtcbiAgICAgICAgICAgIGZvcihsZXQga2V5IGluIGhlYWRlcnMpIHtcbiAgICAgICAgICAgICAgICBpZighdGhpcy5maWx0ZXJlZEhlYWRlckxpc3QuaW5jbHVkZXMoa2V5KSkge1xuICAgICAgICAgICAgICAgICAgICBoZWFkZXJNYXBba2V5XSA9IGhlYWRlcnNba2V5XTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRoaXMucHJpbnRRdWV1ZS5wdXNoKEpTT04uc3RyaW5naWZ5KGhlYWRlck1hcCkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIG1ha2VVcmwodXJsPzogc3RyaW5nKSB7XG4gICAgICAgIGlmKHRoaXMuY29uZmlnLnVybCAmJiB1cmwpIHRoaXMucHJpbnRRdWV1ZS5wdXNoKHVybCk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIG1ha2VNZXRob2QobWV0aG9kPzogc3RyaW5nKSB7XG4gICAgICAgIGlmKHRoaXMuY29uZmlnLm1ldGhvZCAmJiBtZXRob2QpIHRoaXMucHJpbnRRdWV1ZS5wdXNoKGNoYWxrLnllbGxvdyhtZXRob2QudG9VcHBlckNhc2UoKSkpO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICBtYWtlRGF0YShkYXRhOiBvYmplY3QpIHtcbiAgICAgICAgaWYodGhpcy5jb25maWcuZGF0YSAmJiBkYXRhKSB0aGlzLnByaW50UXVldWUucHVzaChKU09OLnN0cmluZ2lmeShkYXRhKSk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIG1ha2VTdGF0dXMoc3RhdHVzPzpudW1iZXIsIHN0YXR1c1RleHQ/OiBzdHJpbmcpIHtcbiAgICAgICAgaWYoc3RhdHVzICYmIHN0YXR1c1RleHQpIHRoaXMucHJpbnRRdWV1ZS5wdXNoKGAke3N0YXR1c306JHtzdGF0dXNUZXh0fWApO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICBidWlsZCgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMucHJpbnRRdWV1ZS5qb2luKCcgJyk7XG4gICAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBTdHJpbmdCdWlsZGVyO1xuIl19 | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tb24vc3RyaW5nLWJ1aWxkZXIudHMiXSwibmFtZXMiOlsiU3RyaW5nQnVpbGRlciIsImNvbnN0cnVjdG9yIiwiY29uZmlnIiwicHJpbnRRdWV1ZSIsImZpbHRlcmVkSGVhZGVyTGlzdCIsIm1ha2VMb2dUeXBlV2l0aFByZWZpeCIsImxvZ1R5cGUiLCJwcmVmaXgiLCJwcmVmaXhUZXh0IiwicHVzaCI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vbmZpZy5zdGF0dXMgJiYgc3RhdHVzKSB0aGlzLnByaW50UXVldWUucHVzaChgJHtzdGF0dXN9YCk7XG4gICAgICAgIGVsc2UgaWYodGhpcy5jb25maWcuc3RhdHVzVGV4dCAmJiBzdGF0dXNUZXh0KSB0aGlzLnByaW50UXVldWUucHVzaChzdGF0dXNUZXh0KTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgYnVpbGQoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnByaW50UXVldWUuam9pbignICcpO1xuICAgIH1cbn1cblxuZXhwb3J0IGRlZmF1bHQgU3RyaW5nQnVpbGRlcjtcbiJdfQ== |
@@ -5,3 +5,3 @@ export interface CommonConfig { | ||
headers?: boolean; | ||
logger: (text: string) => any; | ||
logger?: (text: string) => any; | ||
} | ||
@@ -14,3 +14,2 @@ export interface GlobalLogConfig extends CommonConfig { | ||
statusText?: boolean; | ||
code?: boolean; | ||
} | ||
@@ -29,3 +28,2 @@ export interface RequestLogConfig extends CommonConfig { | ||
data?: boolean; | ||
code?: boolean; | ||
} |
import { AxiosError } from 'axios'; | ||
import { ErrorLogConfig } from '../common/types'; | ||
declare function errorLoggerWithoutPromise(error: AxiosError, config?: ErrorLogConfig): AxiosError; | ||
declare function errorLogger(error: AxiosError): Promise<never>; | ||
declare function errorLogger(error: AxiosError, config?: ErrorLogConfig): Promise<never>; | ||
export { errorLogger, errorLoggerWithoutPromise }; |
@@ -13,7 +13,5 @@ "use strict"; | ||
var _print = require("../common/print"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function errorLoggerWithoutPromise(error, config) { | ||
function errorLoggerWithoutPromise(error, config = {}) { | ||
const { | ||
@@ -38,9 +36,9 @@ config: { | ||
const log = stringBuilder.makeLogTypeWithPrefix('Error').makeDateFormat(new Date()).makeMethod(method).makeUrl(url).makeStatus(status, statusText).makeHeader(headers).makeData(data).build(); | ||
(0, _print.printLog)(log); | ||
buildConfig.logger(log); | ||
return error; | ||
} | ||
function errorLogger(error) { | ||
return Promise.reject(errorLoggerWithoutPromise(error)); | ||
function errorLogger(error, config) { | ||
return Promise.reject(errorLoggerWithoutPromise(error, config)); | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sb2dnZXIvZXJyb3IudHMiXSwibmFtZXMiOlsiZXJyb3JMb2dnZXJXaXRob3V0UHJvbWlzZSIsImVycm9yIiwiY29uZmlnIiwibWV0aG9kIiwidXJsIiwicmVzcG9uc2UiLCJzdGF0dXMiLCJzdGF0dXNUZXh0IiwiZGF0YSIsImhlYWRlcnMiLCJidWlsZENvbmZpZyIsInN0cmluZ0J1aWxkZXIiLCJTdHJpbmdCdWlsZGVyIiwibG9nIiwibWFrZUxvZ1R5cGVXaXRoUHJlZml4IiwibWFrZURhdGVGb3JtYXQiLCJEYXRlIiwibWFrZU1ldGhvZCIsIm1ha2VVcmwiLCJtYWtlU3RhdHVzIiwibWFrZUhlYWRlciIsIm1ha2VEYXRhIiwiYnVpbGQiLCJlcnJvckxvZ2dlciIsIlByb21pc2UiLCJyZWplY3QiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBRUE7O0FBQ0E7O0FBQ0E7Ozs7QUFFQSxTQUFTQSx5QkFBVCxDQUFtQ0MsS0FBbkMsRUFBc0RDLE1BQXRELEVBQStFO0FBRTNFLFFBQU07QUFBQ0EsSUFBQUEsTUFBTSxFQUFFO0FBQUVDLE1BQUFBLE1BQUY7QUFBVUMsTUFBQUE7QUFBVixLQUFUO0FBQTBCQyxJQUFBQTtBQUExQixNQUFzQ0osS0FBNUM7QUFFQSxNQUFJSyxNQUFKLEVBQVlDLFVBQVosRUFBd0JDLElBQXhCLEVBQThCQyxPQUE5Qjs7QUFDQSxNQUFJSixRQUFKLEVBQWM7QUFDVkMsSUFBQUEsTUFBTSxHQUFHRCxRQUFRLENBQUNDLE1B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ubWFrZVVybCh1cmwpXG4gICAgICAgIC5tYWtlU3RhdHVzKHN0YXR1cywgc3RhdHVzVGV4dClcbiAgICAgICAgLm1ha2VIZWFkZXIoaGVhZGVycylcbiAgICAgICAgLm1ha2VEYXRhKGRhdGEpXG4gICAgICAgIC5idWlsZCgpO1xuXG4gICAgYnVpbGRDb25maWcubG9nZ2VyKGxvZyk7XG5cbiAgICByZXR1cm4gZXJyb3I7XG59XG5cbmZ1bmN0aW9uIGVycm9yTG9nZ2VyKGVycm9yOiBBeGlvc0Vycm9yLCBjb25maWc/OiBFcnJvckxvZ0NvbmZpZykge1xuICAgIHJldHVybiBQcm9taXNlLnJlamVjdChlcnJvckxvZ2dlcldpdGhvdXRQcm9taXNlKGVycm9yLCBjb25maWcpKTtcbn1cblxuZXhwb3J0IHsgZXJyb3JMb2dnZXIsIGVycm9yTG9nZ2VyV2l0aG91dFByb21pc2UgfTtcbiJdfQ== |
@@ -12,7 +12,5 @@ "use strict"; | ||
var _print = require("../common/print"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function requestLogger(request, config) { | ||
function requestLogger(request, config = {}) { | ||
const { | ||
@@ -27,3 +25,3 @@ url, | ||
const log = stringBuilder.makeLogTypeWithPrefix('Request').makeDateFormat(new Date()).makeMethod(method).makeUrl(url).makeHeader(headers).makeData(data).build(); | ||
(0, _print.printLog)(log); | ||
buildConfig.logger(log); | ||
return request; | ||
@@ -34,2 +32,2 @@ } | ||
exports.default = _default; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sb2dnZXIvcmVxdWVzdC50cyJdLCJuYW1lcyI6WyJyZXF1ZXN0TG9nZ2VyIiwicmVxdWVzdCIsImNvbmZpZyIsInVybCIsIm1ldGhvZCIsImRhdGEiLCJoZWFkZXJzIiwiYnVpbGRDb25maWciLCJzdHJpbmdCdWlsZGVyIiwiU3RyaW5nQ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O1xuaW1wb3J0IHsgUmVxdWVzdExvZ0NvbmZpZyB9IGZyb20gJy4uL2NvbW1vbi90eXBlcyc7XG5pbXBvcnQgeyBhc3NlbWJsZUJ1aWxkQ29uZmlnIH0gZnJvbSAnLi4vY29tbW9uL2NvbmZpZyc7XG5pbXBvcnQgU3RyaW5nQnVpbGRlciBmcm9tICcuLi9jb21tb24vc3RyaW5nLWJ1aWxkZXInO1xuXG5mdW5jdGlvbiByZXF1ZXN0TG9nZ2VyKHJlcXVlc3Q6IEF4aW9zUmVxdWVzdENvbmZpZywgY29uZmlnOiBSZXF1ZXN0TG9nQ29uZmlnID0ge30pIHtcblxuICAgIGNvbnN0IHt1cmwsIG1ldGhvZCwgZGF0YSwgaGVhZGVyc30gPSByZXF1ZXN0O1xuICAgIGNvbnN0IGJ1aWxkQ29uZmlnID0gYXNzZW1ibGVCdWlsZENvbmZpZyhjb25maWcpO1xuXG4gICAgY29uc3Qgc3RyaW5nQnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKGJ1aWxkQ29uZmlnKTtcbiAgICBjb25zdCBsb2cgPSBzdHJpbmdCdWlsZGVyXG4gICAgICAgIC5tYWtlTG9nVHlwZVdpdGhQcmVmaXgoJ1JlcXVlc3QnKVxuICAgICAgICAubWFrZURhdGVGb3JtYXQobmV3IERhdGUoKSlcbiAgICAgICAgLm1ha2VNZXRob2QobWV0aG9kKVxuICAgICAgICAubWFrZVVybCh1cmwpXG4gICAgICAgIC5tYWtlSGVhZGVyKGhlYWRlcnMpXG4gICAgICAgIC5tYWtlRGF0YShkYXRhKVxuICAgICAgICAuYnVpbGQoKTtcblxuICAgIGJ1aWxkQ29uZmlnLmxvZ2dlcihsb2cpO1xuXG4gICAgcmV0dXJuIHJlcXVlc3Q7XG59XG5cbmV4cG9ydCBkZWZhdWx0IHJlcXVlc3RMb2dnZXI7XG4iXX0= |
@@ -12,7 +12,5 @@ "use strict"; | ||
var _print = require("../common/print"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function responseLogger(response, config) { | ||
function responseLogger(response, config = {}) { | ||
const { | ||
@@ -31,3 +29,3 @@ config: { | ||
const log = stringBuilder.makeLogTypeWithPrefix('Response').makeDateFormat(new Date()).makeMethod(method).makeUrl(url).makeStatus(status, statusText).makeHeader(headers).makeData(data).build(); | ||
(0, _print.printLog)(log); | ||
buildConfig.logger(log); | ||
return response; | ||
@@ -38,2 +36,2 @@ } | ||
exports.default = _default; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sb2dnZXIvcmVzcG9uc2UudHMiXSwibmFtZXMiOlsicmVzcG9uc2VMb2dnZXIiLCJyZXNwb25zZSIsImNvbmZpZyIsInVybCIsIm1ldGhvZCIsInN0YXR1cyIsInN0YXR1c1RleHQiLCJkYXRhIiwiaGVhZGVycyIsImJ1aWxkQ29uZmlnIiwic3RyaW5nQnVpbGRlciIsIlN0cmluZ0J1aWxkZXIiLCJsb2ciLCJtYWtlTG9nVHlwZVdpdGhQcmVmaXgiLCJtYWtlRGF0ZUZvcm1hdCIsIkRhdGUiLCJtYWtlTWV0aG9kIiwibWFrZVVybCIsIm1ha2VTdGF0dXMiLCJtYWtlSGVhZGVyIiwibWFrZURhdGEiLCJidWlsZCJdLCJtYXBwaW5ncyI6Ijs7Ozs7OztBQUVBOztBQUNBOztBQUNBOzs7O0FBRUEsU0FBU0EsY0FBVCxDQUF3QkMsUUFBeEIsRUFBaURDLE1BQWpELEVBQTZFO0FBQ3pFLFFBQU07QUFBQ0EsSUFBQUEsTUFBTSxFQUFFO0FBQUNDLE1BQUFBLEdBQUQ7QUFBTUMsTUFBQUE7QUFBTixLQUFUO0FBQXdCQyxJQUFBQSxNQUF4QjtBQUFnQ0MsSUFBQUEsVUFBaEM7QUFBNENDLElBQUFBLElBQTVDO0FBQWtEQyxJQUFBQTtBQUFsRCxNQUE2RFAsUUFBbkU7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VpbGRDb25maWcgfSBmcm9tICcuLi9jb21tb24vY29uZmlnJztcbmltcG9ydCBTdHJpbmdCdWlsZGVyIGZyb20gJy4uL2NvbW1vbi9zdHJpbmctYnVpbGRlcic7XG5cbmZ1bmN0aW9uIHJlc3BvbnNlTG9nZ2VyKHJlc3BvbnNlOiBBeGlvc1Jlc3BvbnNlLCBjb25maWc6IFJlc3BvbnNlTG9nQ29uZmlnID0ge30pIHtcbiAgICBjb25zdCB7Y29uZmlnOiB7dXJsLCBtZXRob2R9LCBzdGF0dXMsIHN0YXR1c1RleHQsIGRhdGEsIGhlYWRlcnN9ID0gcmVzcG9uc2U7XG4gICAgY29uc3QgYnVpbGRDb25maWcgPSBhc3NlbWJsZUJ1aWxkQ29uZmlnKGNvbmZpZyk7XG5cbiAgICBjb25zdCBzdHJpbmdCdWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoYnVpbGRDb25maWcpO1xuICAgIGNvbnN0IGxvZyA9IHN0cmluZ0J1aWxkZXJcbiAgICAgICAgLm1ha2VMb2dUeXBlV2l0aFByZWZpeCgnUmVzcG9uc2UnKVxuICAgICAgICAubWFrZURhdGVGb3JtYXQobmV3IERhdGUoKSlcbiAgICAgICAgLm1ha2VNZXRob2QobWV0aG9kKVxuICAgICAgICAubWFrZVVybCh1cmwpXG4gICAgICAgIC5tYWtlU3RhdHVzKHN0YXR1cywgc3RhdHVzVGV4dClcbiAgICAgICAgLm1ha2VIZWFkZXIoaGVhZGVycylcbiAgICAgICAgLm1ha2VEYXRhKGRhdGEpXG4gICAgICAgIC5idWlsZCgpO1xuXG4gICAgYnVpbGRDb25maWcubG9nZ2VyKGxvZyk7XG5cbiAgICByZXR1cm4gcmVzcG9uc2U7XG59XG5cbmV4cG9ydCBkZWZhdWx0IHJlc3BvbnNlTG9nZ2VyO1xuIl19 |
{ | ||
"name": "axios-logger", | ||
"version": "2.4.0", | ||
"version": "2.5.0", | ||
"description": "Beautify Axios Logging Messages", | ||
@@ -20,3 +20,3 @@ "main": "lib/index.js", | ||
"type": "git", | ||
"url": "git+https://github.com/hg-pyun/axios-intercept-logger.git" | ||
"url": "git+https://github.com/hg-pyun/axios-logger.git" | ||
}, | ||
@@ -27,18 +27,18 @@ "author": "Haegul Pyun", | ||
"bugs": { | ||
"url": "https://github.com/hg-pyun/axios-intercept-logger/issues" | ||
"url": "https://github.com/hg-pyun/axios-logger/issues" | ||
}, | ||
"homepage": "https://github.com/hg-pyun/axios-intercept-logger#readme", | ||
"homepage": "https://github.com/hg-pyun/axios-logger#readme", | ||
"devDependencies": { | ||
"@babel/cli": "^7.7.7", | ||
"@babel/core": "^7.7.7", | ||
"@babel/plugin-proposal-class-properties": "^7.7.4", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.7.7", | ||
"@babel/preset-env": "^7.7.7", | ||
"@babel/preset-typescript": "^7.7.7", | ||
"@types/jest": "^24.0.25", | ||
"@types/node": "^12.12.22", | ||
"@babel/cli": "^7.12.10", | ||
"@babel/core": "^7.12.10", | ||
"@babel/plugin-proposal-class-properties": "^7.12.1", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.12.1", | ||
"@babel/preset-env": "^7.12.11", | ||
"@babel/preset-typescript": "^7.12.7", | ||
"@types/jest": "^24.9.1", | ||
"@types/node": "^12.19.9", | ||
"axios": "^0.18.0", | ||
"body-parser": "^1.19.0", | ||
"compression": "^1.7.4", | ||
"cookie-parser": "^1.4.4", | ||
"cookie-parser": "^1.4.5", | ||
"cross-env": "^5.2.1", | ||
@@ -50,7 +50,7 @@ "express": "^4.17.1", | ||
"prettier": "^1.19.1", | ||
"typescript": "^3.7.4" | ||
"typescript": "^3.9.7" | ||
}, | ||
"dependencies": { | ||
"@types/dateformat": "^3.0.1", | ||
"chalk": "^2.4.1", | ||
"chalk": "^4.1.0", | ||
"dateformat": "^3.0.3" | ||
@@ -78,4 +78,5 @@ }, | ||
"test:server": "node ./test/server.js", | ||
"deploy": "npm test && npm run build && npm publish" | ||
"prepare": "npm run build", | ||
"deploy": "npm test && npm publish" | ||
} | ||
} |
@@ -100,6 +100,8 @@ # axios-logger | ||
headers: true, | ||
logger: someLogger.info.bind(this), | ||
}); | ||
``` | ||
Or it can also be passed on as a second argument and applied locally. | ||
Or it can also be passed on as a second argument and applied locally. In this case, any property explicitly defined will | ||
override the global configuration. | ||
@@ -114,2 +116,3 @@ ```javascript | ||
headers: true, | ||
logger: someLogger.error.bind(this), | ||
}); | ||
@@ -121,16 +124,15 @@ }); | ||
| Property | Type | Default | Description | | ||
|--------------|--------|---------|----------------------------------------| | ||
| `method` | boolean | `true` | Whether to include HTTP method or not. | | ||
| `url` | boolean | `true` | Whether to include the URL or not. | | ||
| `data` | boolean | `true` | Whether to include request/response data or not. | | ||
| `status` | boolean | `true` | Whether to include response statuses or not. | | ||
| `headers` | boolean | `false` | Whether to include HTTP headers or not. | | ||
| `prefixText` | string \| `false` | `'Axios'` | `false` => no prefix, otherwise, customize the prefix wanted. | | ||
| `dateFormat` | [dateformat](https://github.com/felixge/node-dateformat) \| `false` | `new Date().toISOString()` | `false` => no timestamp, otherwise, customize its format | | ||
| `logger` | function<string, any> | `console.log` | Allows users to customize the logger function to be used. e.g. Winston's `logger.info` could be leveraged | | ||
| Property | Type | Default | Description | | ||
| ------------ | ------------------------------------------------------------------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `method` | boolean | `true` | Whether to include HTTP method or not. | | ||
| `url` | boolean | `true` | Whether to include the URL or not. | | ||
| `data` | boolean | `true` | Whether to include request/response data or not. | | ||
| `status` | boolean | `true` | Whether to include response statuses or not. | | ||
| `headers` | boolean | `false` | Whether to include HTTP headers or not. | | ||
| `prefixText` | string \| `false` | `'Axios'` | `false` => no prefix, otherwise, customize the prefix wanted. | | ||
| `dateFormat` | [dateformat](https://github.com/felixge/node-dateformat) \| `false` | `new Date().toISOString()` | `false` => no timestamp, otherwise, customize its format | | ||
| `logger` | function<string, any> | `console.log` | Allows users to customize the logger function to be used. e.g. Winston's `logger.info` could be leveraged, like this: `logger.info.bind(this)` | | ||
## CONTRIBUTE | ||
I always welcome Feedback and Pull Request :) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40792
136
19
285
+ Addedansi-styles@4.3.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedsupports-color@7.2.0(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedsupports-color@5.5.0(transitive)
Updatedchalk@^4.1.0