Skip to content

fix: log device identifier on success message when tns run command is executed #3931

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/common/services/livesync-service-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class LiveSyncServiceBase implements ILiveSyncServiceBase {

private async transferFiles(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[], projectFilesPath: string, isFullSync: boolean): Promise<void> {
this.$logger.info("Transferring project files...");
this.logFilesSyncInformation(localToDevicePaths, "Transferring %s.", this.$logger.trace);
this.logFilesSyncInformation(localToDevicePaths, "Transferring %s on device %s.", this.$logger.trace, deviceAppData.device.deviceInfo.identifier);

const canTransferDirectory = isFullSync && (this.$devicesService.isAndroidDevice(deviceAppData.device) || this.$devicesService.isiOSSimulator(deviceAppData.device));
if (canTransferDirectory) {
Expand All @@ -238,13 +238,13 @@ class LiveSyncServiceBase implements ILiveSyncServiceBase {
await this.$liveSyncProvider.transferFiles(deviceAppData, localToDevicePaths, projectFilesPath, isFullSync);
}

this.logFilesSyncInformation(localToDevicePaths, "Successfully transferred %s.", this.$logger.info);
this.logFilesSyncInformation(localToDevicePaths, "Successfully transferred %s on device %s.", this.$logger.info, deviceAppData.device.deviceInfo.identifier);
}

private logFilesSyncInformation(localToDevicePaths: Mobile.ILocalToDevicePathData[], message: string, action: Function): void {
private logFilesSyncInformation(localToDevicePaths: Mobile.ILocalToDevicePathData[], message: string, action: Function, deviceIdentifier: string): void {
if (this.showFullLiveSyncInformation) {
_.each(localToDevicePaths, (file: Mobile.ILocalToDevicePathData) => {
action.call(this.$logger, util.format(message, path.basename(file.getLocalPath()).yellow));
action.call(this.$logger, util.format(message, path.basename(file.getLocalPath()).yellow), deviceIdentifier);
});
} else {
action.call(this.$logger, util.format(message, "all files"));
Expand Down
6 changes: 3 additions & 3 deletions lib/services/livesync/platform-livesync-service-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export abstract class PlatformLiveSyncServiceBase {

transferredFiles = await deviceLiveSyncService.transferFiles(deviceAppData, localToDevicePaths, projectFilesPath, projectData, liveSyncDeviceInfo, options);

this.logFilesSyncInformation(transferredFiles, "Successfully transferred %s.", this.$logger.info);
this.logFilesSyncInformation(transferredFiles, "Successfully transferred %s on device %s.", this.$logger.info, deviceAppData.device.deviceInfo.identifier);

return transferredFiles;
}
Expand All @@ -139,10 +139,10 @@ export abstract class PlatformLiveSyncServiceBase {
};
}

private logFilesSyncInformation(localToDevicePaths: Mobile.ILocalToDevicePathData[], message: string, action: Function): void {
private logFilesSyncInformation(localToDevicePaths: Mobile.ILocalToDevicePathData[], message: string, action: Function, deviceIdentifier: string): void {
if (localToDevicePaths && localToDevicePaths.length < 10) {
_.each(localToDevicePaths, (file: Mobile.ILocalToDevicePathData) => {
action.call(this.$logger, util.format(message, path.basename(file.getLocalPath()).yellow));
action.call(this.$logger, util.format(message, path.basename(file.getLocalPath()).yellow), deviceIdentifier);
});
} else {
action.call(this.$logger, util.format(message, "all files"));
Expand Down