Skip to content

Commit a4ce0ba

Browse files
authored
Merge pull request #232 from mattlyons0/master
Extend documentation on DEBUG_FD and DEBUG_COLORS
2 parents 3c0f3da + 3fac232 commit a4ce0ba

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

Readme.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,14 @@ setInterval(function(){
120120
Colored output looks something like:
121121

122122
![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png)
123+
124+
## Output streams
123125

126+
124127
### stderr vs stdout
125-
126-
You can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally:
128+
By default `debug` will log to stderr, however this can be changed by setting the environment variable `DEBUG_FD` to `1` for stdout and `2` for stderr (the default value).
129+
130+
You can also set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally:
127131

128132
Example _stdout.js_:
129133

@@ -157,6 +161,12 @@ Example:
157161
$ DEBUG_FD=3 node your-app.js 3> whatever.log
158162
```
159163

164+
### Terminal colors
165+
166+
By default colors will only be used in a TTY. However this can be overridden by setting the environment variable `USE_COLORS` to `1`.
167+
168+
Note: Certain IDEs (such as WebStorm) don't support colors on stderr. In these cases you must set `USE_COLORS` to `1` and additionally change `DEBUG_FD` to `1`.
169+
160170
## Authors
161171

162172
- TJ Holowaychuk

0 commit comments

Comments
 (0)