Merge pull request #9268 from atom/tj-electron-logging

Use ELECTRON_ENABLE_LOGGING instead of console.log shims
This commit is contained in:
Thomas Johansen
2015-11-18 18:52:00 +01:00
4 changed files with 7 additions and 10 deletions

View File

@@ -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"

View File

@@ -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" %*

View File

@@ -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" "$@"

View File

@@ -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()