Import and export Logs

Summary: This diff adds import and export support for the logs plugin

Reviewed By: danielbuechele

Differential Revision: D13958713

fbshipit-source-id: a072de025f0b959302175ef0ccaf763ca41377e9
This commit is contained in:
Pritesh Nandgaonkar
2019-02-12 02:33:29 -08:00
committed by Facebook Github Bot
parent e5151b9994
commit c28ef62f07
4 changed files with 69 additions and 9 deletions

View File

@@ -5,16 +5,30 @@
* @format
*/
import BaseDevice from './BaseDevice.js';
import type {DeviceType, OS, DeviceShell} from './BaseDevice.js';
import type {
DeviceType,
OS,
DeviceShell,
DeviceLogEntry,
} from './BaseDevice.js';
export default class ArchivedDevice extends BaseDevice {
constructor(serial: string, deviceType: DeviceType, title: string, os: OS) {
constructor(
serial: string,
deviceType: DeviceType,
title: string,
os: OS,
logEntries: Array<DeviceLogEntry>,
) {
super(serial, deviceType, title);
this.os = os;
this.logs = logEntries;
}
logs: Array<DeviceLogEntry>;
getLogs() {
return [];
return this.logs;
}
spawnShell(): ?DeviceShell {

View File

@@ -41,6 +41,7 @@ export type DeviceExport = {|
title: string,
deviceType: DeviceType,
serial: string,
logs: Array<DeviceLogEntry>,
|};
export type OS = 'iOS' | 'Android' | 'Windows';
@@ -80,6 +81,7 @@ export default class BaseDevice {
title: this.title,
deviceType: this.deviceType,
serial: this.serial,
logs: this.getLogs(),
};
}