frontend/.pnpm-store/v3/files/40/ac622899d7f472a13f5d7d4fb6fb0bea140ab4a39c576dbdd2e0b4b638024960ec10aa4bbcf230dcba0cc2378cbc0e8265eff5af41ac69057e93d1e450cdca

31 lines
938 B
Plaintext

'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const VERSION = "1.0.4";
/**
* @param octokit Octokit instance
* @param options Options passed to Octokit constructor
*/
function requestLog(octokit) {
octokit.hook.wrap("request", (request, options) => {
octokit.log.debug("request", options);
const start = Date.now();
const requestOptions = octokit.request.endpoint.parse(options);
const path = requestOptions.url.replace(options.baseUrl, "");
return request(options).then(response => {
octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);
return response;
}).catch(error => {
octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`);
throw error;
});
});
}
requestLog.VERSION = VERSION;
exports.requestLog = requestLog;
//# sourceMappingURL=index.js.map