github-pages-deploy-action/node_modules/@octokit/plugin-request-log
2020-03-02 08:16:42 -05:00
..
dist-node Dependencies 2020-03-02 08:16:42 -05:00
dist-src Dependencies 2020-03-02 08:16:42 -05:00
dist-types Dependencies 2020-03-02 08:16:42 -05:00
dist-web Dependencies 2020-03-02 08:16:42 -05:00
LICENSE Dependencies 2020-03-02 08:16:42 -05:00
package.json Dependencies 2020-03-02 08:16:42 -05:00
README.md Dependencies 2020-03-02 08:16:42 -05:00

plugin-request-log.js

Log all requests and request errors

@latest Build Status Greenkeeper

Usage

Browsers

Load @octokit/plugin-request-log and @octokit/core (or core-compatible module) directly from cdn.pika.dev

<script type="module">
  import { Octokit } from "https://cdn.pika.dev/@octokit/core";
  import { requestLog } from "https://cdn.pika.dev/@octokit/plugin-request-log";
</script>
Node

Install with npm install @octokit/core @octokit/plugin-request-log. Optionally replace @octokit/core with a core-compatible module

const { Octokit } = require("@octokit/core");
const { requestLog } = require("@octokit/plugin-request-log");
const MyOctokit = Octokit.plugin(requestLog);
const octokit = new MyOctokit({ auth: "secret123" });

octokit.request("GET /");
// logs "GET / - 200 in 123ms

octokit.request("GET /oops");
// logs "GET / - 404 in 123ms

In order to log all request options, the log.debug option needs to be set. We recommend the console-log-level package for a configurable log level

const octokit = new MyOctokit({
  log: require("console-log-level")({
    auth: "secret123",
    level: "info"
  })
});

Contributing

See CONTRIBUTING.md

License

MIT