Skip to content

Commit 3fac232

Browse files
committed
Extend documentation on DEBUG_FD and DEBUG_COLORS
Move 'stderr vs stdout' and 'Save debug output to a file' to their own heading. Fix #205
1 parent dc983db commit 3fac232

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
@@ -114,10 +114,14 @@ setInterval(function(){
114114
Colored output looks something like:
115115

116116
![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png)
117+
118+
## Output streams
117119

120+
118121
### stderr vs stdout
119-
120-
You can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally:
122+
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).
123+
124+
You can also set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally:
121125

122126
Example _stdout.js_:
123127

@@ -151,6 +155,12 @@ Example:
151155
$ DEBUG_FD=3 node your-app.js 3> whatever.log
152156
```
153157

158+
### Terminal colors
159+
160+
By default colors will only be used in a TTY. However this can be overridden by setting the environment variable `USE_COLORS` to `1`.
161+
162+
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`.
163+
154164
## Authors
155165

156166
- TJ Holowaychuk

0 commit comments

Comments
 (0)