Log IPC messages with verbose: 'full' by ehmicky · Pull Request #1063 · sindresorhus/execa (original) (raw)
Currently, when the verbose option is 'full', the subprocess' stdout/stderr is logged.
With this PR, IPC messages are logged as well, providing both the ipc option is true and the verbose option is 'full'.
This should help users debug IPC-related bugs.
$ node build.js
[20:36:11.043] [0] $ npm run build
[20:36:11.200] [0] Running build...
[20:36:11.300] [0] * First IPC message, as a string
[20:36:11.300] [0] * {message: 'Second IPC message, as an object'}
[20:36:11.400] [0] More output...
[20:36:11.885] [0] ✔ (done in 842ms)
Also, currently, users can choose what to log. For example, to log stderr but not stdout: execa(..., {verbose: {stdout: 'none', stderr: 'full'}). This PR extends this syntax to IPC as well. For example, to log stdout/stderr but not IPC: execa(..., {verbose: {stdout: 'full', stderr: 'full', ipc: 'none'}).