Package Exports
- @octokit/plugin-request-log
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@octokit/plugin-request-log) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
plugin-request-log.js
Log all requests and request errors
Usage
Browsers |
Load <script type="module">
import { Octokit } from "https://cdn.skypack.dev/@octokit/core";
import { requestLog } from "https://cdn.skypack.dev/@octokit/plugin-request-log";
</script> |
---|---|
Node |
Install with 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