From a8147c09a291357834a12a257e9de8f80cb9ad59 Mon Sep 17 00:00:00 2001 From: Thomas Johansen Date: Fri, 23 Oct 2015 22:01:49 +0200 Subject: [PATCH 1/2] :fire: Remove console.log shims --- src/initialize-test-window.coffee | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/initialize-test-window.coffee b/src/initialize-test-window.coffee index 375581a96..f3507b479 100644 --- a/src/initialize-test-window.coffee +++ b/src/initialize-test-window.coffee @@ -21,16 +21,7 @@ module.exports = ({blobStore}) -> {testRunnerPath, legacyTestRunnerPath, headless, logFile, testPaths} = getWindowLoadSettings() - if headless - # Override logging in headless mode so it goes to the console, regardless - # of the --enable-logging flag to Electron. - console.log = (args...) -> - ipc.send 'write-to-stdout', args.join(' ') + '\n' - console.warn = (args...) -> - ipc.send 'write-to-stderr', args.join(' ') + '\n' - console.error = (args...) -> - ipc.send 'write-to-stderr', args.join(' ') + '\n' - else + unless headless # Show window synchronously so a focusout doesn't fire on input elements # that are focused in the very first spec run. remote.getCurrentWindow().show() From ae09d687a0c194b6adefb8eb9450c8d5689716d0 Mon Sep 17 00:00:00 2001 From: Thomas Johansen Date: Fri, 23 Oct 2015 22:02:33 +0200 Subject: [PATCH 2/2] Re-enable console.log via ELECTRON_ENABLE_LOGGING --- atom.sh | 4 ++++ resources/win/atom.cmd | 1 + resources/win/atom.sh | 1 + 3 files changed, 6 insertions(+) diff --git a/atom.sh b/atom.sh index fcabc0e52..ef8dbcdc4 100755 --- a/atom.sh +++ b/atom.sh @@ -50,6 +50,10 @@ if [ $REDIRECT_STDERR ]; then exec 2> /dev/null fi +if [ $EXPECT_OUTPUT ]; then + export ELECTRON_ENABLE_LOGGING=1 +fi + if [ $OS == 'Mac' ]; then if [ -n "$BETA_VERSION" ]; then ATOM_APP_NAME="Atom Beta.app" diff --git a/resources/win/atom.cmd b/resources/win/atom.cmd index 04a4ccbb0..d3188b3ea 100644 --- a/resources/win/atom.cmd +++ b/resources/win/atom.cmd @@ -16,6 +16,7 @@ FOR %%a IN (%*) DO ( ) IF "%EXPECT_OUTPUT%"=="YES" ( + SET ELECTRON_ENABLE_LOGGING=YES "%~dp0\..\..\atom.exe" %* ) ELSE ( "%~dp0\..\app\apm\bin\node.exe" "%~dp0\atom.js" %* diff --git a/resources/win/atom.sh b/resources/win/atom.sh index b6edeeb57..9e2c6da65 100644 --- a/resources/win/atom.sh +++ b/resources/win/atom.sh @@ -18,6 +18,7 @@ done directory=$(dirname "$0") if [ $EXPECT_OUTPUT ]; then + export ELECTRON_ENABLE_LOGGING=1 "$directory/../../atom.exe" "$@" else "$directory/../app/apm/bin/node.exe" "$directory/atom.js" "$@"