1.1.0 • Published 4 years ago

cslog v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

cslog

Colorful & Simple React Console Logger

NPM JavaScript Style Guide

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

  1. bg (background color)
  2. fg (foreground color)
  3. 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

License

MIT © shivampip

1.0.2

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago