jayfella c97084e992 Initial Commit 5 năm trước cách đây
..
dist-node c97084e992 Initial Commit 5 năm trước cách đây
dist-src c97084e992 Initial Commit 5 năm trước cách đây
dist-types c97084e992 Initial Commit 5 năm trước cách đây
dist-web c97084e992 Initial Commit 5 năm trước cách đây
LICENSE c97084e992 Initial Commit 5 năm trước cách đây
README.md c97084e992 Initial Commit 5 năm trước cách đây
package.json c97084e992 Initial Commit 5 năm trước cách đây

README.md

plugin-request-log.js

Log all requests and request errors

Build Status Greenkeeper

Usage

Browsers Load `@octokit/plugin-request-log` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [cdn.pika.dev](https://cdn.pika.dev) ```html ```
Node Install with `npm install @octokit/core @octokit/plugin-request-log`. Optionally replace `@octokit/core` with a core-compatible module ```js 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