A browser console.log()
tool, which can make the printed message look better.
Using npm:
npm install b-pretty-log
Using yarn:
yarn add b-pretty-log
Using jsDelivr CDN:
<script src="https://cdn.jsdelivr.net/npm/b-pretty-log/dist/index.js"></script>
Import libraries in entry file:
import log from 'b-pretty-log'
Print a message:
log('info', 'Component is mounted')
More ways to use it:
const err = { code: 404, msg: 'Not Found' }
log('Success', 'Request successful!', 'success')
log('Warn', 'This is not supported!', 'warning')
log('Error', err, 'danger')
log.error('-->>', err)
// pretty log style
const res = { code: 200, msg: 'success', data: true }
log.pretty('Info', 'Request Info', res)
log.pretty('Success', '-->>', 'Success Info', 'success')
- **text: **Content in a wireframe or box
- content: The content behind a wireframe or square
- color:
<ColorType>
or hex color value,<ColoType>
has'success' | 'warning' | 'danger' | 'info' | 'primary'(default)
- back: Is display background, the text will be white
log.success(text, content)
log.warn(text, content)
log.error(text, content)
log.info(text, content)
- title: Text on the background
- text: Text on the border
- content: details
- color:
<ColorType>
or hex color value,<ColoType>
has'success' | 'warning' | 'danger' | 'info' | 'primary'(default)