kolog

0.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i kolog

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

8.61 kB

Total Files

10

Last publish

Collaborators

  • kalazbb