Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend documentation on DEBUG_FD and DEBUG_COLORS #232

Merged
merged 1 commit into from
Oct 22, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,14 @@ setInterval(function(){
Colored output looks something like:

![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png)

## 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_:

Expand Down Expand Up @@ -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`.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DEBUG_COLORS


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
Expand Down