Socket
Socket
Sign inDemoInstall

@octokit/plugin-request-log

Package Overview
Dependencies
0
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/plugin-request-log


Version published
Weekly downloads
5.1M
decreased by-3.16%
Maintainers
2
Created
Weekly downloads
 

Readme

Source

plugin-request-log.js

Log all requests and request errors

@latest Build Status

Usage

Browsers

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

<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 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

Keywords

FAQs

Last updated on 11 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc