1.0.7 • Published 8 years ago

log1 v1.0.7

Weekly downloads
14
License
MIT
Repository
github
Last release
8 years ago

log1 = log for global、env or debug

Build npm version

make all console.xx to global

global log

require('log1')

log('global log')

global log with env

require('log1')()

log('global log')

when NODE_ENV=production,will not print any log

export NODE_ENV=production && node test.js

otherwise,print log

global log disable

require('log1')(true)

log('global log')

this will not print any log

export NODE_ENV=production && node test/log-disable.js

use debug module

https://github.com/visionmedia/debug

use log1 namespace as default

require('log1')()

var name = 'My App'

debug('booting %s', name);

exec show debug info

$ export DEBUG=log1 && node test/debug.js
log1 booting My App +0ms

use custom namespace

require('log1')(true, 'namespace')

var name = 'My App'

debug('booting %s', name);

exec show debug info

$ export DEBUG=namespace && node test/custom-debug.js
namespace custom booting My App +0ms
1.0.7

8 years ago

1.0.6

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.0

8 years ago