0.0.1 • Published 5 years ago

kolog v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

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!

Docs: https://node-kolog.github.io