1.0.8 • Published 3 years ago
@knivesq/p-logger v1.0.8
Welcome to p-logger! Your preferred Axios Logger!
The purpose of this library is to easily read response and request logs with a cool collapsed feature where you can see the response data, configs, headers and what not.
Installation
You can either:
yarn add @knivesq/p-logger --dev
or
npm install @knivesq/p-logger --save-dev
Usage
import { logError, logSuccess } from "@knivesq/p-logger";
// axios interceptors for success response and error
axios.interceptors.response.use(logSuccess, logError);
// or add multiple apis from axios.create
[api, api2, api3].map((api) => {
api.interceptors.response.use(logSuccess, logError);
return api;
});
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.