1.0.0 • Published 5 years ago

axios-basic-logger v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

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