GithubHelp home page GithubHelp logo

isabella232 / plugin-request-log.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from octokit/plugin-request-log.js

0.0 0.0 0.0 1.24 MB

Log all requests and request errors

License: MIT License

TypeScript 100.00%

plugin-request-log.js's Introduction

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

plugin-request-log.js's People

Contributors

dependabot[bot] avatar renovate[bot] avatar gr2m avatar greenkeeper[bot] avatar oscard0m avatar wolfy1339 avatar nickfloyd avatar heroichitesh avatar jhutchings1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.