From b5bdf4acb9f1fbd1775d94cc4d696cc396fcef7e Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 2 Aug 2017 21:03:29 -0600 Subject: [PATCH 1/3] Don't enable electron logging by default --- atom.sh | 7 +++---- resources/win/atom.cmd | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/atom.sh b/atom.sh index 6b0e94430..b36938bc5 100755 --- a/atom.sh +++ b/atom.sh @@ -31,6 +31,9 @@ while getopts ":wtfvh-:" opt; do foreground|benchmark|benchmark-test|test) EXPECT_OUTPUT=1 ;; + enable-electron-logging) + export ELECTRON_ENABLE_LOGGING=1 + ;; esac ;; w) @@ -50,10 +53,6 @@ if [ $REDIRECT_STDERR ]; then exec 2> /dev/null fi -if [ $EXPECT_OUTPUT ]; then - export ELECTRON_ENABLE_LOGGING=1 -fi - if [ $OS == 'Mac' ]; then if [ -L "$0" ]; then SCRIPT="$(readlink "$0")" diff --git a/resources/win/atom.cmd b/resources/win/atom.cmd index 43ec8ebe3..40f07b872 100644 --- a/resources/win/atom.cmd +++ b/resources/win/atom.cmd @@ -5,16 +5,17 @@ SET WAIT= SET PSARGS=%* FOR %%a IN (%*) DO ( - IF /I "%%a"=="-f" SET EXPECT_OUTPUT=YES - IF /I "%%a"=="--foreground" SET EXPECT_OUTPUT=YES - IF /I "%%a"=="-h" SET EXPECT_OUTPUT=YES - IF /I "%%a"=="--help" SET EXPECT_OUTPUT=YES - IF /I "%%a"=="-t" SET EXPECT_OUTPUT=YES - IF /I "%%a"=="--test" SET EXPECT_OUTPUT=YES - IF /I "%%a"=="--benchmark" SET EXPECT_OUTPUT=YES - IF /I "%%a"=="--benchmark-test" SET EXPECT_OUTPUT=YES - IF /I "%%a"=="-v" SET EXPECT_OUTPUT=YES - IF /I "%%a"=="--version" SET EXPECT_OUTPUT=YES + IF /I "%%a"=="-f" SET EXPECT_OUTPUT=YES + IF /I "%%a"=="--foreground" SET EXPECT_OUTPUT=YES + IF /I "%%a"=="-h" SET EXPECT_OUTPUT=YES + IF /I "%%a"=="--help" SET EXPECT_OUTPUT=YES + IF /I "%%a"=="-t" SET EXPECT_OUTPUT=YES + IF /I "%%a"=="--test" SET EXPECT_OUTPUT=YES + IF /I "%%a"=="--benchmark" SET EXPECT_OUTPUT=YES + IF /I "%%a"=="--benchmark-test" SET EXPECT_OUTPUT=YES + IF /I "%%a"=="-v" SET EXPECT_OUTPUT=YES + IF /I "%%a"=="--version" SET EXPECT_OUTPUT=YES + IF /I "%%a"=="--enable-electron-logging" SET ELECTRON_ENABLE_LOGGING=YES IF /I "%%a"=="-w" ( SET EXPECT_OUTPUT=YES SET WAIT=YES @@ -26,7 +27,6 @@ FOR %%a IN (%*) DO ( ) IF "%EXPECT_OUTPUT%"=="YES" ( - SET ELECTRON_ENABLE_LOGGING=YES IF "%WAIT%"=="YES" ( powershell -noexit "Start-Process -FilePath \"%~dp0\..\..\atom.exe\" -ArgumentList \"--pid=$pid $env:PSARGS\" ; wait-event" exit 0 From 55748bd2c4a4ea70d4b541eec51e6b5fb293e599 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 2 Aug 2017 21:12:02 -0600 Subject: [PATCH 2/3] Document enable-electron-logging option --- src/main-process/parse-command-line.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main-process/parse-command-line.js b/src/main-process/parse-command-line.js index 3f9f2523a..7531e609b 100644 --- a/src/main-process/parse-command-line.js +++ b/src/main-process/parse-command-line.js @@ -55,6 +55,7 @@ module.exports = function parseCommandLine (processArgs) { options.string('socket-path') options.string('user-data-dir') options.boolean('clear-window-state').describe('clear-window-state', 'Delete all Atom environment state.') + options.boolean('enable-electron-logging').describe('enable-electron-logging', 'Enable low-level logging messages from Electron.') const args = options.argv From 18c5a31fbc9061b3f8fb5deff38262152196115b Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 3 Aug 2017 11:53:36 -0600 Subject: [PATCH 3/3] Unset ELECTRON_ENABLE_LOGGING on Windows unless explicitly requested --- resources/win/atom.cmd | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/win/atom.cmd b/resources/win/atom.cmd index 40f07b872..07b9933cb 100644 --- a/resources/win/atom.cmd +++ b/resources/win/atom.cmd @@ -3,6 +3,7 @@ SET EXPECT_OUTPUT= SET WAIT= SET PSARGS=%* +SET ELECTRON_ENABLE_LOGGING= FOR %%a IN (%*) DO ( IF /I "%%a"=="-f" SET EXPECT_OUTPUT=YES