0.0.1 • Published 5 years ago
kolog v0.0.1
Kolog
Advanced logging util for nodejs
Installing:
NPM:
npm i kolog
Yarn:
yarn add kolog
Example:
var Kolog = require('kolog')
var logger = new Kolog.Logger({scope: 'normal logs'})
console.log('--LOGGER--')
logger.log('genericLog')
logger.warn('Warning')
logger.error('error')
logger.success('success')
logger.info('info')
This will log:
--LOGGER--
normal logs: genericLog
normal logs: ⚠ Warning
normal logs: ✖ error
normal logs: ✔ success
normal logs: ℹ info
It also supports custom loggers!
var Kolog = require('kolog')
var logger = new Kolog.Logger({scope: 'normal logs', types: [{
name: "update",
color: "blue",
scope: 'Updates',
emoji: ''
}]})
logger.update('Hey')
This will log:
Updates: Hey
Custom loggers also support templates, here is an example:
var Kolog = require('kolog')
var logger = new Kolog.Logger({scope: 'normal logs', types: [{
name: "update",
color: "blue",
scope: 'Updates',
emoji: '',
template: "New update with name: {text}"
}]})
logger.update('v.1.2.79')
It will log:
Updates: New update with name: v.1.2.79
The result of the examples are colored!
0.0.1
5 years ago