| | |
| | | # debug |
| | | [](https://travis-ci.org/visionmedia/debug) [](https://coveralls.io/github/visionmedia/debug?branch=master) [](https://visionmedia-community-slackin.now.sh/) [](#backers) |
| | | [](https://travis-ci.org/debug-js/debug) [](https://coveralls.io/github/debug-js/debug?branch=master) [](https://visionmedia-community-slackin.now.sh/) [](#backers) |
| | | [](#sponsors) |
| | | |
| | | <img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png"> |
| | |
| | | }, 1200); |
| | | ``` |
| | | |
| | | In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_. |
| | | |
| | | <img width="647" src="https://user-images.githubusercontent.com/7143133/152083257-29034707-c42c-4959-8add-3cee850e6fcf.png"> |
| | | |
| | | ## Output streams |
| | | |
| | |
| | | You can also manually toggle this property to force the debug instance to be |
| | | enabled or disabled. |
| | | |
| | | ## Usage in child processes |
| | | |
| | | Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process. |
| | | For example: |
| | | |
| | | ```javascript |
| | | worker = fork(WORKER_WRAP_PATH, [workerPath], { |
| | | stdio: [ |
| | | /* stdin: */ 0, |
| | | /* stdout: */ 'pipe', |
| | | /* stderr: */ 'pipe', |
| | | 'ipc', |
| | | ], |
| | | env: Object.assign({}, process.env, { |
| | | DEBUG_COLORS: 1 // without this settings, colors won't be shown |
| | | }), |
| | | }); |
| | | |
| | | worker.stderr.pipe(process.stderr, { end: false }); |
| | | ``` |
| | | |
| | | |
| | | ## Authors |
| | | |
| | | - TJ Holowaychuk |
| | | - Nathan Rajlich |
| | | - Andrew Rhyne |
| | | - Josh Junon |
| | | |
| | | ## Backers |
| | | |
| | |
| | | (The MIT License) |
| | | |
| | | Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> |
| | | Copyright (c) 2018-2021 Josh Junon |
| | | |
| | | Permission is hereby granted, free of charge, to any person obtaining |
| | | a copy of this software and associated documentation files (the |