-
Notifications
You must be signed in to change notification settings - Fork 16
/
debug.node.txt
24 lines (19 loc) · 2.24 KB
/
debug.node.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
DEBUG
VERSION ==> #Node module (1.0.2)
#More featureful version of Node builtin UTIL.debuglog():
# - can include subcategory
# - can use other than console.error()
# - can be used in browser
DEBUG(STR) #Returns a FUNC(...) (déf: console.log(...):
#which will be fired only if ENVVAR DEBUG=VAL is set, where:
# - VAL is [-]STR,... (STR can be "*")
# - STR should be APPNAME[:SUBCATEGORY]
#FUNC() can be customized with DEBUG[(STR)].log = FUNC(...)), so can be combined with log4js,
#but log4js should be used for production, debug for development.
#Arguments STR... of FUNC(...):
# - can include "+NNNms", which will be replaced by last call delay of FUNC()
# - can include "%c" formatting option with CSS_VAL, e.g. "color:red"
#Can be used in browser too.
DEBUG.disable() #