mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
Merge pull request #9268 from atom/tj-electron-logging
Use ELECTRON_ENABLE_LOGGING instead of console.log shims
This commit is contained in:
4
atom.sh
4
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"
|
||||
|
||||
@@ -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" %*
|
||||
|
||||
@@ -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" "$@"
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user