cslog
v1.1.0
Published
Colorful & Simple React Console Logger
Downloads
30
Readme
cslog
Colorful & Simple React Console Logger
Install
npm install --save cslog
Usage
import React, { Component } from 'react'
import log from 'cslog'
const App = () => {
log.success('Hello World') //debug messages
log.error('Hello World')
log.d(data, 'PersonInfo') //variable
log.d(data)
log.h1('Hello World') //Header tag
log.hi('Hello JS', 'blue', 'yellow', true) //Blue text on yellow background, Broder: true
log.p('This is a sample paragraph. it is multiline') //Paragraph tag
log.p('I am different color text', 'white', 'purple') //White text on purple background
log.b('I am Bold') //Bold
log.bi('I am Bold italic') //Bold + Italic
return <h2>Check Console</h2>
}
export default App
Color log variable values.
const lname = 'I speak Hindi & English'
const data = {
name: 'Shivam Agrawal',
city: 'Pipariya'
}
log.d(lname, 'Language')
log.d(data, 'PersonInfo')
Debug messages
log.success('Hello World')
log.error('Hello World')
log.info('Hello World')
log.warn('Hello World')
Simple HTML tags in console
log.h1('Hello World')
log.h2('Hello World')
log.h3('Hello World')
log.h4('Hello World')
log.p('Hello')
log.p('This is a sample paragraph. it is multiline')
log.b('I am Bold')
log.br()
log.i('I am Bold')
log.bi('I am Bold italic')
All HTML functions accepts three options parameters
- bg (background color)
- fg (foreground color)
- border (enable/disable border)
log.h3('I am unique styled text', 'green', 'black', true) //Green text on black background, border enabled
Chage Global Settings
log.border(true) //Enable border globally
log.setColor('red') //Set global color: red
If you like it
- Follow me on Github
License
MIT © shivampip