appium-xcuitest-driver
Version:
Appium driver for iOS using XCUITest for backend
42 lines • 1.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.IOSDeviceLog = void 0;
const appium_ios_device_1 = require("appium-ios-device");
const line_consuming_log_1 = require("./line-consuming-log");
class IOSDeviceLog extends line_consuming_log_1.LineConsumingLog {
udid;
showLogs;
service;
constructor(opts) {
super({ log: opts.log });
this.udid = opts.udid;
this.showLogs = !!opts.showLogs;
this.service = null;
}
async startCapture() {
if (this.service) {
return;
}
this.service = await appium_ios_device_1.services.startSyslogService(this.udid);
this.service.start(this.onLog.bind(this));
}
get isCapturing() {
return !!this.service;
}
async stopCapture() {
if (!this.service) {
return;
}
this.service.close();
this.service = null;
}
onLog(logLine) {
this.broadcast(logLine);
if (this.showLogs) {
this.log.info(`[IOS_SYSLOG_ROW] ${logLine}`);
}
}
}
exports.IOSDeviceLog = IOSDeviceLog;
exports.default = IOSDeviceLog;
//# sourceMappingURL=ios-device-log.js.map