Detalhes do pacote

humint

zerobias574MIT1.2.1

Colorfull tagged logger

logger, log, winston, debug

readme (leia-me)

humint

Humint tagged logger for node.

Install

npm install --save humint

Usage

Lets write some short sequences

import Logger from 'humint'
const log = Logger`module name`
//Its short form for Logger('module name')
log`done`('Logger active')
log('you','can','use')('any','number','of','tags')
log(['or nested',['arrays','of','tags','and,combinations']])('...')
log`or,just,write,with,comma`({ objects:['or','arrays'] },'are valid too')
log`error,something going wrong`(
    'error will have red higlight, any other tags will be yellow')

Also you can use error, warn or info(default) methods (winston native feature)

log.warn`warning`('Logger active')
log.error`oop`('error info')

Map

For arrays you can use .map method

log.map`Print array`(['each', 'element', 'will', 'logs', 'on', 'new', 'line'])

Debug

Debug-like behavior. Method .debug will prints only when module name includes in DEBUG enviroment variable

set DEBUG=humint:* & node index.js

const log = require('humint')('humint:debugging')

log.debug`debug info`('You will see this only when DEBUG is set')

License

MIT © Zero Bias

changelog (log de mudanças)

Changelog

All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.

1.2.1

  • Added github links to package.json

1.2.0

  • Added .map method for printing array elements

  • Added .debug method for debug-like behavior

  • Trim module name

  • Test coverage

  • Added strict styleguide .eslintrc.js

  • Update ramda deps

=< 1.1.3

  • First several working versions by @zerobias