Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@octokit/plugin-request-log

Package Overview
Dependencies
Maintainers
4
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/plugin-request-log

Log all requests and request errors

  • 5.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.3M
increased by2.25%
Maintainers
4
Weekly downloads
 
Created

What is @octokit/plugin-request-log?

@octokit/plugin-request-log is a plugin for Octokit that logs all requests made to the GitHub API. It is useful for debugging and monitoring the requests your application makes to GitHub.

What are @octokit/plugin-request-log's main functionalities?

Logging Requests

This feature allows you to log all requests made to the GitHub API. The code sample demonstrates how to create an Octokit instance with the requestLog plugin and make a request to the GitHub API, which will be logged.

const { Octokit } = require('@octokit/core');
const { requestLog } = require('@octokit/plugin-request-log');

const MyOctokit = Octokit.plugin(requestLog);

const octokit = new MyOctokit();

async function logRequests() {
  await octokit.request('GET /repos/{owner}/{repo}', {
    owner: 'octocat',
    repo: 'hello-world'
  });
}

logRequests();

Custom Log Output

This feature allows you to customize the log output by providing your own logging functions. The code sample demonstrates how to create an Octokit instance with custom log functions and make a request to the GitHub API, which will be logged using the custom functions.

const { Octokit } = require('@octokit/core');
const { requestLog } = require('@octokit/plugin-request-log');

const MyOctokit = Octokit.plugin(requestLog);

const octokit = new MyOctokit({
  log: {
    debug: console.debug,
    info: console.info,
    warn: console.warn,
    error: console.error
  }
});

async function logRequests() {
  await octokit.request('GET /repos/{owner}/{repo}', {
    owner: 'octocat',
    repo: 'hello-world'
  });
}

logRequests();

Other packages similar to @octokit/plugin-request-log

Keywords

FAQs

Package last updated on 16 Jul 2024

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc