1.0.4 ⢠Published 7 years ago
cmlog v1.0.4
Cmlog
āļø Emoji console logger
Installation
Using yarn:
$ yarn add cmlogUsing npm:
$ npm i cmlogGetting started
import cmlog from "cmlog"
// See types section for all available types
cmlog.debug('export something')
cmlog.warn('Something is going to happen soon')
cmlog.success('Build succeeed in 10 seconds')
cmlog.info('Some extra info is here')
cmlog.error(new Error('Foo'))
Types
A list of all available default types:
- ā
cmlog.success(...str) - šµ
cmlog.info(...str) - š„
cmlog.warn(...str) - š
cmlog.debug(...str) - ā
cmlog.waitting(...str) - š„
cmlog.boosting(...str) - š¶
cmlog.start(...str) - āØ
cmlog.done(...str) - š¦
cmlog.pack(title, ...str) - āŖ
cmlog.module(title, ...str) - ā
cmlog.error(Error)
Split / Blank
cmlog.split(char, count)cmlog.blank(lines)
// default: char = "="; count = 40
cmlog.split()
// output:
// =========================================
// default: lines = 1;
cmlog.blank()Log object
cmlog.json(obj, title)
cmlog.json("{foo:bar}","Format")Terminal log:
āŖ Format
{
foo: bar
}Dye string
cmlog.dye(color, ...str)
return:
string
Colors
blackredgreenyellowbluemagentacyanwhitegrayredBrightgreenBrightyellowBrightblueBrightmagentaBrightcyanBrightwhiteBright
Config
import { Cmlog } from "cmlog"
// default config
const cmlog = new Cmlog({
align : true, // whether to align info
maxLength: 8, // (align:true) the max spacings to add
debug : true, // whether to show debug log
time : false // whether to show time info
})License
MIT