mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-19 13:08:27 +02:00
feat: add @actions/cache
This commit is contained in:
parent
b15fb7d098
commit
16e8c96a41
1932 changed files with 261172 additions and 10 deletions
35
node_modules/@azure/ms-rest-js/es/lib/policies/logPolicy.js
generated
vendored
Normal file
35
node_modules/@azure/ms-rest-js/es/lib/policies/logPolicy.js
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
import { __extends } from "tslib";
|
||||
import { BaseRequestPolicy, } from "./requestPolicy";
|
||||
export function logPolicy(logger) {
|
||||
if (logger === void 0) { logger = console.log; }
|
||||
return {
|
||||
create: function (nextPolicy, options) {
|
||||
return new LogPolicy(nextPolicy, options, logger);
|
||||
},
|
||||
};
|
||||
}
|
||||
var LogPolicy = /** @class */ (function (_super) {
|
||||
__extends(LogPolicy, _super);
|
||||
function LogPolicy(nextPolicy, options, logger) {
|
||||
if (logger === void 0) { logger = console.log; }
|
||||
var _this = _super.call(this, nextPolicy, options) || this;
|
||||
_this.logger = logger;
|
||||
return _this;
|
||||
}
|
||||
LogPolicy.prototype.sendRequest = function (request) {
|
||||
var _this = this;
|
||||
return this._nextPolicy.sendRequest(request).then(function (response) { return logResponse(_this, response); });
|
||||
};
|
||||
return LogPolicy;
|
||||
}(BaseRequestPolicy));
|
||||
export { LogPolicy };
|
||||
function logResponse(policy, response) {
|
||||
policy.logger(">> Request: " + JSON.stringify(response.request, undefined, 2));
|
||||
policy.logger(">> Response status code: " + response.status);
|
||||
var responseBody = response.bodyAsText;
|
||||
policy.logger(">> Body: " + responseBody);
|
||||
return Promise.resolve(response);
|
||||
}
|
||||
//# sourceMappingURL=logPolicy.js.map
|
Loading…
Add table
Add a link
Reference in a new issue