From 16a93aab20cfa8ceef39e4fdddda0975dbf730b0 Mon Sep 17 00:00:00 2001 From: Evan Bacon Date: Mon, 5 Apr 2021 15:09:45 -0700 Subject: [PATCH] clean up logging messages (#3357) * Clean up language * Only clear when selecting a device --- .../expo-cli/src/commands/start/TerminalUI.ts | 23 ++++++++++--------- packages/uri-scheme/src/URIScheme.ts | 4 ++-- packages/xdl/src/Android.ts | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/packages/expo-cli/src/commands/start/TerminalUI.ts b/packages/expo-cli/src/commands/start/TerminalUI.ts index 0a824edaf7..385c912d2f 100644 --- a/packages/expo-cli/src/commands/start/TerminalUI.ts +++ b/packages/expo-cli/src/commands/start/TerminalUI.ts @@ -218,8 +218,10 @@ export async function startAsync(projectRoot: string, options: StartOptions) { switch (key) { case 'A': case 'a': - Log.clear(); - Log.log('Opening the web project in Chrome on Android...'); + if (key === 'A') { + Log.clear(); + } + Log.log(`${BLT} Opening the web project in Chrome on Android...`); await Android.openWebProjectAsync({ projectRoot, shouldPrompt: !options.nonInteractive && key === 'A', @@ -228,8 +230,10 @@ export async function startAsync(projectRoot: string, options: StartOptions) { break; case 'i': case 'I': - Log.clear(); - Log.log('Opening the web project in Safari on iOS...'); + if (key === 'I') { + Log.clear(); + } + Log.log(`${BLT} Opening the web project in Safari on iOS...`); await Simulator.openWebProjectAsync({ projectRoot, shouldPrompt: !options.nonInteractive && key === 'I', @@ -256,8 +260,7 @@ export async function startAsync(projectRoot: string, options: StartOptions) { printHelp(); break; case 'a': { - Log.clear(); - Log.log('Opening on Android...'); + Log.log(`${BLT} Opening on Android...`); await Android.openProjectAsync({ projectRoot, devClient: options.devClient ?? false }); printHelp(); break; @@ -272,8 +275,6 @@ export async function startAsync(projectRoot: string, options: StartOptions) { printHelp(); break; case 'i': { - Log.clear(); - // note(brentvatne): temporarily remove logic for picking the // simulator until we have parity for Android. this also ensures that we // don't interfere with the default user flow until more users have tested @@ -283,7 +284,7 @@ export async function startAsync(projectRoot: string, options: StartOptions) { // const shouldPrompt = // !options.nonInteractive && (key === 'I' || !(await Simulator.isSimulatorBootedAsync())); - Log.log('Opening on iOS...'); + Log.log(`${BLT} Opening on iOS...`); await Simulator.openProjectAsync({ projectRoot, shouldPrompt: false, @@ -315,7 +316,7 @@ export async function startAsync(projectRoot: string, options: StartOptions) { break; } case 'w': { - Log.log('Attempting to open the project in a web browser...'); + Log.log(`${BLT} Open in the web browser...`); await Webpack.openAsync(projectRoot); await printServerInfo(projectRoot, options); break; @@ -416,7 +417,7 @@ Please reload the project in Expo Go for the change to take effect.` } break; case 'o': - Log.log('Trying to open the project in your editor...'); + Log.log(`${BLT} Opening the editor...`); await openInEditorAsync(projectRoot); } } diff --git a/packages/uri-scheme/src/URIScheme.ts b/packages/uri-scheme/src/URIScheme.ts index 18337b626c..3632e68ef3 100644 --- a/packages/uri-scheme/src/URIScheme.ts +++ b/packages/uri-scheme/src/URIScheme.ts @@ -159,11 +159,11 @@ export async function openAsync( options.uri = ensureUriString(options.uri); if (options.ios) { - logPlatformMessage('iOS', `Attempting to open URI "${options.uri}" in simulator`); + logPlatformMessage('iOS', `Opening URI "${options.uri}" in simulator`); await Ios.openAsync(options); } if (options.android) { - logPlatformMessage('Android', `Attempting to open URI "${options.uri}" in emulator`); + logPlatformMessage('Android', `Opening URI "${options.uri}" in emulator`); await Android.openAsync(options); } } diff --git a/packages/xdl/src/Android.ts b/packages/xdl/src/Android.ts index 58278ad930..1ad4507820 100644 --- a/packages/xdl/src/Android.ts +++ b/packages/xdl/src/Android.ts @@ -139,7 +139,7 @@ async function isBootAnimationCompleteAsync(pid?: string): Promise { } async function startEmulatorAsync(device: Pick): Promise { - Logger.global.info(`\u203A Attempting to open emulator: ${device.name}`); + Logger.global.info(`\u203A Opening emulator ${chalk.bold(device.name)}`); // Start a process to open an emulator const emulatorProcess = child_process.spawn(