Skip to content

Commit a45d4a0

Browse files
timrufflesthebigredgeek
authored andcommitted
document .enabled flag (#465)
Was added in #15, should be documented (e.g #423)
1 parent 52e1f21 commit a45d4a0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,18 @@ error('now goes to stdout via console.info');
208208
log('still goes to stdout, but via console.info now');
209209
```
210210

211+
## Checking whether a debug target is enabled
212+
213+
Afer you've created a debug instance, you can check whether it is enabled by its `.enabled` property:
214+
215+
```javascript
216+
const debug = require('debug')('http');
217+
218+
if(debug.enabled) {
219+
// ...
220+
}
221+
```
222+
211223

212224
## Authors
213225

0 commit comments

Comments
 (0)