Skip to content

Commit e874d33

Browse files
chore: handle changes in logger API
There are several changes in logger API that need to be changed in the code - they are mostly renaming of methods.
1 parent b28f5be commit e874d33

40 files changed

+101
-100
lines changed

lib/commands/appstore-list.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ export class ListiOSApps implements ICommand {
3434
const applications = await this.$applePortalApplicationService.getApplications({ username, password });
3535

3636
if (!applications || !applications.length) {
37-
this.$logger.out("Seems you don't have any applications yet.");
37+
this.$logger.info("Seems you don't have any applications yet.");
3838
} else {
3939
const table: any = createTable(["Application Name", "Bundle Identifier", "In Flight Version"], applications.map(application => {
4040
const version = (application && application.versionSets && application.versionSets.length && application.versionSets[0].inFlightVersion && application.versionSets[0].inFlightVersion.version) || "";
4141
return [application.name, application.bundleId, version];
4242
}));
4343

44-
this.$logger.out(table.toString());
44+
this.$logger.info(table.toString());
4545
}
4646
}
4747
}

lib/commands/extensibility/list-extensions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class ListExtensionsCommand implements ICommand {
1313
});
1414

1515
const table = helpers.createTable(["Name", "Version"], data);
16-
this.$logger.out(table.toString());
16+
this.$logger.info(table.toString());
1717
} else {
1818
this.$logger.info("No extensions installed.");
1919
}

lib/commands/list-platforms.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ export class ListPlatformsCommand implements ICommand {
1515
if (installedPlatforms.length > 0) {
1616
const preparedPlatforms = this.$platformService.getPreparedPlatforms(this.$projectData);
1717
if (preparedPlatforms.length > 0) {
18-
this.$logger.out("The project is prepared for: ", helpers.formatListOfNames(preparedPlatforms, "and"));
18+
this.$logger.info("The project is prepared for: ", helpers.formatListOfNames(preparedPlatforms, "and"));
1919
} else {
20-
this.$logger.out("The project is not prepared for any platform");
20+
this.$logger.info("The project is not prepared for any platform");
2121
}
2222

23-
this.$logger.out("Installed platforms: ", helpers.formatListOfNames(installedPlatforms, "and"));
23+
this.$logger.info("Installed platforms: ", helpers.formatListOfNames(installedPlatforms, "and"));
2424
} else {
2525
const formattedPlatformsList = helpers.formatListOfNames(this.$platformService.getAvailablePlatforms(this.$projectData), "and");
26-
this.$logger.out("Available platforms for this OS: ", formattedPlatformsList);
27-
this.$logger.out("No installed platforms found. Use $ tns platform add");
26+
this.$logger.info("Available platforms for this OS: ", formattedPlatformsList);
27+
this.$logger.info("No installed platforms found. Use $ tns platform add");
2828
}
2929
}
3030
}

lib/commands/plugin/list-plugins.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ export class ListPluginsCommand implements ICommand {
1616
const dependenciesData: string[][] = this.createTableCells(installedPlugins.dependencies);
1717

1818
const dependenciesTable: any = createTable(headers, dependenciesData);
19-
this.$logger.out("Dependencies:");
20-
this.$logger.out(dependenciesTable.toString());
19+
this.$logger.info("Dependencies:");
20+
this.$logger.info(dependenciesTable.toString());
2121

2222
if (installedPlugins.devDependencies && installedPlugins.devDependencies.length) {
2323
const devDependenciesData: string[][] = this.createTableCells(installedPlugins.devDependencies);
2424

2525
const devDependenciesTable: any = createTable(headers, devDependenciesData);
2626

27-
this.$logger.out("Dev Dependencies:");
28-
this.$logger.out(devDependenciesTable.toString());
27+
this.$logger.info("Dev Dependencies:");
28+
this.$logger.info(devDependenciesTable.toString());
2929
} else {
30-
this.$logger.out("There are no dev dependencies.");
30+
this.$logger.info("There are no dev dependencies.");
3131
}
3232

3333
const viewDependenciesCommand: string = "npm view <pluginName> grep dependencies".cyan.toString();

lib/commands/post-install.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class PostInstallCliCommand implements ICommand {
3838
}
3939

4040
// Make sure the success message is separated with at least one line from all other messages.
41-
this.$logger.out();
41+
this.$logger.info();
4242
this.$logger.printMarkdown("Installation successful. You are good to go. Connect with us on `http://twitter.com/NativeScript`.");
4343

4444
if (canExecutePostInstallTask) {

lib/common/commands/analytics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class AnalyticsCommand implements ICommand {
4141
break;
4242
case "status":
4343
case "":
44-
this.$logger.out(await this.$analyticsService.getStatusMessage(this.settingName, this.$options.json, this.humanReadableSettingName));
44+
this.$logger.info(await this.$analyticsService.getStatusMessage(this.settingName, this.$options.json, this.humanReadableSettingName));
4545
break;
4646
}
4747
}

lib/common/commands/autocompletion.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class AutoCompleteCommand implements ICommand {
1919
this.$logger.info("Autocompletion is already enabled");
2020
}
2121
} else {
22-
this.$logger.out("If you are using bash or zsh, you can enable command-line completion.");
22+
this.$logger.info("If you are using bash or zsh, you can enable command-line completion.");
2323
const message = "Do you want to enable it now?";
2424

2525
const autoCompetionStatus = await this.$prompter.confirm(message, () => true);

lib/common/commands/device/list-applications.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class ListApplicationsCommand implements ICommand {
1919
};
2020
await this.$devicesService.execute(action);
2121

22-
this.$logger.out(output.join(EOL));
22+
this.$logger.info(output.join(EOL));
2323
}
2424
}
2525
$injector.registerCommand(["device|list-applications", "devices|list-applications"], ListApplicationsCommand);

lib/common/commands/device/list-devices.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ export class ListDevicesCommand implements ICommand {
2323
this.printEmulators("\nAvailable emulators", emulators);
2424
}
2525

26-
this.$logger.out("\nConnected devices & emulators");
26+
this.$logger.info("\nConnected devices & emulators");
2727
let index = 1;
2828
await this.$devicesService.initialize({ platform: args[0], deviceId: null, skipInferPlatform: true, skipDeviceDetectionInterval: true, skipEmulatorStart: true });
2929

3030
const table: any = createTable(["#", "Device Name", "Platform", "Device Identifier", "Type", "Status"], []);
3131
let action: (_device: Mobile.IDevice) => Promise<void>;
3232
if (this.$options.json) {
3333
action = async (device) => {
34-
this.$logger.out(JSON.stringify(device.deviceInfo));
34+
this.$logger.info(JSON.stringify(device.deviceInfo));
3535
};
3636
} else {
3737
action = async (device) => {
@@ -44,18 +44,18 @@ export class ListDevicesCommand implements ICommand {
4444
await this.$devicesService.execute(action, undefined, { allowNoDevices: true });
4545

4646
if (!this.$options.json && table.length) {
47-
this.$logger.out(table.toString());
47+
this.$logger.info(table.toString());
4848
}
4949
}
5050

5151
private printEmulators(title: string, emulators: Mobile.IDeviceInfo[]) {
52-
this.$logger.out(title);
52+
this.$logger.info(title);
5353
const table: any = createTable(["Device Name", "Platform", "Version", "Device Identifier", "Image Identifier", "Error Help"], []);
5454
for (const info of emulators) {
5555
table.push([info.displayName, info.platform, info.version, info.identifier || "", info.imageIdentifier || "", info.errorHelp || ""]);
5656
}
5757

58-
this.$logger.out(table.toString());
58+
this.$logger.info(table.toString());
5959
}
6060
}
6161

lib/common/commands/proxy/proxy-clear.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class ProxyClearCommand extends ProxyCommandBase {
1010

1111
public async execute(args: string[]): Promise<void> {
1212
await this.$proxyService.clearCache();
13-
this.$logger.out("Successfully cleared proxy.");
13+
this.$logger.info("Successfully cleared proxy.");
1414
await this.tryTrackUsage();
1515
}
1616
}

0 commit comments

Comments
 (0)