Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
clean up logging messages (#3357)
Browse files Browse the repository at this point in the history
* Clean up language

* Only clear when selecting a device
  • Loading branch information
EvanBacon authored Apr 5, 2021
1 parent 77f51e3 commit 16a93aa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
23 changes: 12 additions & 11 deletions packages/expo-cli/src/commands/start/TerminalUI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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;
Expand All @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/uri-scheme/src/URIScheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/xdl/src/Android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ async function isBootAnimationCompleteAsync(pid?: string): Promise<boolean> {
}

async function startEmulatorAsync(device: Pick<Device, 'name'>): Promise<Device> {
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(
Expand Down

0 comments on commit 16a93aa

Please sign in to comment.