mirror of
https://github.com/debug-js/debug.git
synced 2026-01-18 16:12:38 +00:00
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
This commit is contained in:
parent
dc983db7d7
commit
3fac2324cd
14
Readme.md
14
Readme.md
@ -114,10 +114,14 @@ setInterval(function(){
|
||||
Colored output looks something like:
|
||||
|
||||

|
||||
|
||||
## Output streams
|
||||
|
||||
|
||||
### stderr vs stdout
|
||||
|
||||
You can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally:
|
||||
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).
|
||||
|
||||
You can also set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally:
|
||||
|
||||
Example _stdout.js_:
|
||||
|
||||
@ -151,6 +155,12 @@ Example:
|
||||
$ DEBUG_FD=3 node your-app.js 3> whatever.log
|
||||
```
|
||||
|
||||
### Terminal colors
|
||||
|
||||
By default colors will only be used in a TTY. However this can be overridden by setting the environment variable `USE_COLORS` to `1`.
|
||||
|
||||
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`.
|
||||
|
||||
## Authors
|
||||
|
||||
- TJ Holowaychuk
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user