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/bootstrap/switches/is_main_thread.js b/lib/internal/bootstrap/switches/is_main_thread.js
index ac8336fb6229e7f44eb00f43abb07bea83a9463c..2005e8ef9ebd090c1be19ff320f48b9cd365239e 100644
--- a/lib/internal/bootstrap/switches/is_main_thread.js
+++ b/lib/internal/bootstrap/switches/is_main_thread.js
@@ -80,6 +80,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();
         }
       });
