From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Kevin Sawicki <kevinsawicki@gmail.com>
Date: Wed, 12 Oct 2016 09:43:26 -0700
Subject: Call process.log from fallback stream on Windows

(cherry picked from commit d31e629b4f2daf3500a485caab2b2990a41e3ad4)

diff --git a/lib/internal/process/stdio.js b/lib/internal/process/stdio.js
index 2491f14cdf01409e4625d6793279ef87dbcc6942..54d3fb23dc1b51fec206e8989e4873d95884583f 100644
--- a/lib/internal/process/stdio.js
+++ b/lib/internal/process/stdio.js
@@ -192,6 +192,11 @@ function createWritableStdioStream(fd) {
       const { Writable } = require('stream');
       stream = new Writable({
         write(buf, enc, cb) {
+          if (process.platform === 'win32' &&
+              process.env.ELECTRON_RUN_AS_NODE &&
+              !process.env.ELECTRON_NO_ATTACH_CONSOLE) {
+            process.log(buf.toString());
+          }
           cb();
         }
       });
