log-group

0.0.3 • Public • Published

log-group manages logs in groups

Usage

npm install log-group

Import this function in CoffeeScript:

= require("../lib/").g
 
g.attrs =
  default: yes
  none: no
 
"default""default log"
"none""no log"
 
g.set "demo"on
 
"demo""when on"
 
g.set "demo"off
 
"demo""when off"
 
"another""not implemented"

Or you may read the source, although it's too short:

= (name, args...) ->
  if g.attrs[name]?
    if g.attrs[namethen console.log args...
  else
    console.log ":::#{name}::: is not implemented in log-group"
 
g.attrs = {}
g.set = (name, status) -> g.attrs[name= status
 
exports.g = g

What I want

Suppose you are debugging Node, whose main tool is console.log.
After debugging, you should comment out all logs.
Doing that by hand is trival(?), so use a function to manage it.

Readme

Keywords

none

Package Sidebar

Install

npm i log-group

Weekly Downloads

0

Version

0.0.3

License

BSD

Last publish

Collaborators

  • jiyinyiyong