Skip to content

Logs request from your preferable request engine

License

Notifications You must be signed in to change notification settings

adspinto/p-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

License

MIT

About

Logs request from your preferable request engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published