Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sahilrajput03/logger-npm
https://github.com/sahilrajput03/logger-npm
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/sahilrajput03/logger-npm
- Owner: sahilrajput03
- Created: 2022-07-26T08:48:52.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-26T11:26:53.000Z (over 2 years ago)
- Last Synced: 2024-11-09T17:58:05.293Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README
**Why?**
- Middleware has coloured output as compared to using morgan's log printing for the requests.
- Simple coloured logs with different levels with matching color schemes i.e., logs related to info, warn and error.
- Prints the line number of the source log instruction as well.Usage:
```js
# INSTALL
npm i sahilrajput03-logger# FOR GENERAL LOGGING
const {loggert, logger} = require('sahilrajput03-logger')
const data = {friend: 'mercedes'} // can be anything
logger.warn(data)
logger.info(data)
logger.err(data)# FOR MIDDLEWARE
const {logMw} = require('@sahil/logger')
app.use(logMw)# FOR SETTING UP MY FAVOURITE COLORS
const {setupColors} = require('sahilrajput03-logger')
setupColors()console.log('wowo'.mb) // To view list of available colors you can look into `lib/setupColors.js` file.
```