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..07b9933cb 100644 --- a/resources/win/atom.cmd +++ b/resources/win/atom.cmd @@ -3,18 +3,20 @@ SET EXPECT_OUTPUT= SET WAIT= SET PSARGS=%* +SET ELECTRON_ENABLE_LOGGING= 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 +28,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 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