/axios-basic-logger

Axios logging interceptors

Primary LanguageJavaScriptMIT LicenseMIT

axios-basic-logger

package version package downloads standard-readme compliant package license make a pull request Commitizen friendly

Axios logging interceptors

Table of Contents

Install

This project uses node and npm.

$ npm install axios-basic-logger
$ # OR
$ yarn add axios-basic-logger

Usage

import axios from "axios";
import useLogger from "axios-basic-logger";

useLogger(axios);

axios
  .get("https://jsonplaceholder.typicode.com/todos")
  .then(() => console.log("ja"));

// REQUEST  10:35:16:244 GET https://jsonplaceholder.typicode.com/todos 
// RESPONSE 10:35:16:283 200 (GET https://jsonplaceholder.typicode.com/todos) 39ms 
// ja

Contribute

  1. Fork it and create your feature branch: git checkout -b my-new-feature
  2. Commit your changes: git commit -am "Add some feature"
  3. Push to the branch: git push origin my-new-feature
  4. Submit a pull request

License

MIT