Show console output from Windows when ELECTRON_RUN_AS_NODE is set #7578

Merged
merged 6 commits into from Oct 17, 2016

Projects

None yet

3 participants

@kevinsawicki
Contributor
kevinsawicki commented Oct 12, 2016 edited

This pull request follows the approach outlined in #5715 (comment) to enable console output on Windows when electron is run with ELECTRON_RUN_AS_NODE.

Exposes process.log when run in a node context and calls that from the fallback streams created when stdout and stderr fail to initialize in node (which is happening on release builds).

screen shot 2016-10-12 at 10 30 52 am

Depends on electron/node#19

/cc @bpasero

kevinsawicki added some commits Oct 11, 2016
@kevinsawicki kevinsawicki Expose process.log when running as node d686916
@kevinsawicki kevinsawicki Reuse Log method 0740b2f
@kevinsawicki kevinsawicki Upgrade node for process logging fix patch 0417a3e
@kevinsawicki kevinsawicki Only expose process.log on Windows b01fd97
@kevinsawicki kevinsawicki Add basic test of spawned ELECTRON_RUN_AS_NODE process e899050
@kevinsawicki kevinsawicki Moving atom_bindings include to Windows block
a8382d6
@bpasero
Contributor
bpasero commented Oct 13, 2016

@kevinsawicki thanks 👍

@zcbenz
Contributor
zcbenz commented Oct 17, 2016

👍

@zcbenz zcbenz merged commit ce847fc into master Oct 17, 2016

8 of 9 checks passed

electron-mas-x64 Build #2619 failed in 8 min 51 sec
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
electron-linux-arm Build #4405343 succeeded in 67s
Details
electron-linux-ia32 Build #4405344 succeeded in 62s
Details
electron-linux-x64 Build #4405345 succeeded in 119s
Details
electron-osx-x64 Build #2627 succeeded in 10 min
Details
electron-win-ia32 Build #1715 succeeded in 8 min 9 sec
Details
electron-win-x64 Build #1691 succeeded in 8 min 18 sec
Details
@zcbenz zcbenz deleted the windows-logging branch Oct 17, 2016
@jviotti jviotti added a commit to resin-io/etcher that referenced this pull request Oct 25, 2016
@jviotti jviotti fix(GUI): emit progress back to parent using node-ipc
This PR makes use of `node-ipc` to emit progress information from the
child CLI to the GUI process rather than the tailing approach we've
been doing until now.

This change was motivated by the following Electron fix which landed in
v1.4.4: electron/electron#7578. Before such fix,
Electron would not output anything to stdout/stderr if the Electron
process was running with `ELECTRON_RUN_AS_NODE` under Windows, which
forced us to implement `--log` option in the Etcher CLI to output state
information to a file.

Since this issue is fixed, we can consume the Etcher CLI output from
within `child_process.spawn`, which opens more interesting possibilities
for sharing information between both processes.

This coindentally fixes a Windows issue where the tailing module would
receive malformed JSON, causing Etcher to crash at `JSON.parse`. The
reason of this problem was a bug in the tailing module we were using.

Fixes: #642
Change-Type: patch
Changelog-Entry: Fix "Unexpected end of JSON" error in Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
05d7680
@jviotti jviotti referenced this pull request in resin-io/etcher Oct 25, 2016
Merged

fix(GUI): emit progress back to parent using node-ipc #774

@jviotti jviotti added a commit to resin-io/etcher that referenced this pull request Oct 25, 2016
@jviotti jviotti fix(GUI): emit progress back to parent using node-ipc
This PR makes use of `node-ipc` to emit progress information from the
child CLI to the GUI process rather than the tailing approach we've
been doing until now.

This change was motivated by the following Electron fix which landed in
v1.4.4: electron/electron#7578. Before such fix,
Electron would not output anything to stdout/stderr if the Electron
process was running with `ELECTRON_RUN_AS_NODE` under Windows, which
forced us to implement `--log` option in the Etcher CLI to output state
information to a file.

Since this issue is fixed, we can consume the Etcher CLI output from
within `child_process.spawn`, which opens more interesting possibilities
for sharing information between both processes.

This coindentally fixes a Windows issue where the tailing module would
receive malformed JSON, causing Etcher to crash at `JSON.parse`. The
reason of this problem was a bug in the tailing module we were using.

Fixes: #642
Change-Type: patch
Changelog-Entry: Fix "Unexpected end of JSON" error in Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
1c9db1a
@jviotti jviotti added a commit to resin-io/etcher that referenced this pull request Oct 25, 2016
@jviotti jviotti fix(GUI): emit progress back to parent using node-ipc
This PR makes use of `node-ipc` to emit progress information from the
child CLI to the GUI process rather than the tailing approach we've
been doing until now.

This change was motivated by the following Electron fix which landed in
v1.4.4: electron/electron#7578. Before such fix,
Electron would not output anything to stdout/stderr if the Electron
process was running with `ELECTRON_RUN_AS_NODE` under Windows, which
forced us to implement `--log` option in the Etcher CLI to output state
information to a file.

Since this issue is fixed, we can consume the Etcher CLI output from
within `child_process.spawn`, which opens more interesting possibilities
for sharing information between both processes.

This coindentally fixes a Windows issue where the tailing module would
receive malformed JSON, causing Etcher to crash at `JSON.parse`. The
reason of this problem was a bug in the tailing module we were using.

Fixes: #642
Change-Type: patch
Changelog-Entry: Fix "Unexpected end of JSON" error in Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
4d19ccd
@jviotti jviotti added a commit to resin-io/etcher that referenced this pull request Oct 25, 2016
@jviotti jviotti fix(GUI): emit progress back to parent using node-ipc
This PR makes use of `node-ipc` to emit progress information from the
child CLI to the GUI process rather than the tailing approach we've
been doing until now.

This change was motivated by the following Electron fix which landed in
v1.4.4: electron/electron#7578. Before such fix,
Electron would not output anything to stdout/stderr if the Electron
process was running with `ELECTRON_RUN_AS_NODE` under Windows, which
forced us to implement `--log` option in the Etcher CLI to output state
information to a file.

Since this issue is fixed, we can consume the Etcher CLI output from
within `child_process.spawn`, which opens more interesting possibilities
for sharing information between both processes.

This coindentally fixes a Windows issue where the tailing module would
receive malformed JSON, causing Etcher to crash at `JSON.parse`. The
reason of this problem was a bug in the tailing module we were using.

Fixes: #642
Change-Type: patch
Changelog-Entry: Fix "Unexpected end of JSON" error in Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
e3e20a4
@jviotti jviotti added a commit to resin-io/etcher that referenced this pull request Oct 25, 2016
@jviotti jviotti fix(GUI): emit progress back to parent using node-ipc
This PR makes use of `node-ipc` to emit progress information from the
child CLI to the GUI process rather than the tailing approach we've
been doing until now.

This change was motivated by the following Electron fix which landed in
v1.4.4: electron/electron#7578. Before such fix,
Electron would not output anything to stdout/stderr if the Electron
process was running with `ELECTRON_RUN_AS_NODE` under Windows, which
forced us to implement `--log` option in the Etcher CLI to output state
information to a file.

Since this issue is fixed, we can consume the Etcher CLI output from
within `child_process.spawn`, which opens more interesting possibilities
for sharing information between both processes.

This coindentally fixes a Windows issue where the tailing module would
receive malformed JSON, causing Etcher to crash at `JSON.parse`. The
reason of this problem was a bug in the tailing module we were using.

Fixes: #642
Change-Type: patch
Changelog-Entry: Fix "Unexpected end of JSON" error in Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
144f2ba
@jviotti jviotti added a commit to resin-io/etcher that referenced this pull request Oct 26, 2016
@jviotti jviotti fix(GUI): emit progress back to parent using node-ipc
This PR makes use of `node-ipc` to emit progress information from the
child CLI to the GUI process rather than the tailing approach we've
been doing until now.

This change was motivated by the following Electron fix which landed in
v1.4.4: electron/electron#7578. Before such fix,
Electron would not output anything to stdout/stderr if the Electron
process was running with `ELECTRON_RUN_AS_NODE` under Windows, which
forced us to implement `--log` option in the Etcher CLI to output state
information to a file.

Since this issue is fixed, we can consume the Etcher CLI output from
within `child_process.spawn`, which opens more interesting possibilities
for sharing information between both processes.

This coindentally fixes a Windows issue where the tailing module would
receive malformed JSON, causing Etcher to crash at `JSON.parse`. The
reason of this problem was a bug in the tailing module we were using.

Fixes: #642
Change-Type: patch
Changelog-Entry: Fix "Unexpected end of JSON" error in Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
1d6e079
@jviotti jviotti added a commit to resin-io/etcher that referenced this pull request Oct 26, 2016
@jviotti jviotti fix(GUI): emit progress back to parent using node-ipc
This PR makes use of `node-ipc` to emit progress information from the
child CLI to the GUI process rather than the tailing approach we've
been doing until now.

This change was motivated by the following Electron fix which landed in
v1.4.4: electron/electron#7578. Before such fix,
Electron would not output anything to stdout/stderr if the Electron
process was running with `ELECTRON_RUN_AS_NODE` under Windows, which
forced us to implement `--log` option in the Etcher CLI to output state
information to a file.

Since this issue is fixed, we can consume the Etcher CLI output from
within `child_process.spawn`, which opens more interesting possibilities
for sharing information between both processes.

This coindentally fixes a Windows issue where the tailing module would
receive malformed JSON, causing Etcher to crash at `JSON.parse`. The
reason of this problem was a bug in the tailing module we were using.

Fixes: #642
Change-Type: patch
Changelog-Entry: Fix "Unexpected end of JSON" error in Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
6b63068
@jviotti jviotti added a commit to resin-io/etcher that referenced this pull request Oct 26, 2016
@jviotti jviotti fix(GUI): emit progress back to parent using node-ipc (#774)
This PR makes use of `node-ipc` to emit progress information from the
child CLI to the GUI process rather than the tailing approach we've
been doing until now.

This change was motivated by the following Electron fix which landed in
v1.4.4: electron/electron#7578. Before such fix,
Electron would not output anything to stdout/stderr if the Electron
process was running with `ELECTRON_RUN_AS_NODE` under Windows, which
forced us to implement `--log` option in the Etcher CLI to output state
information to a file.

Since this issue is fixed, we can consume the Etcher CLI output from
within `child_process.spawn`, which opens more interesting possibilities
for sharing information between both processes.

This coindentally fixes a Windows issue where the tailing module would
receive malformed JSON, causing Etcher to crash at `JSON.parse`. The
reason of this problem was a bug in the tailing module we were using.

Fixes: #642
Change-Type: patch
Changelog-Entry: Fix "Unexpected end of JSON" error in Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
d9822fa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment