UNPKG

mobile-cli-lib

Version:
33 lines (32 loc) 1.54 kB
"use strict"; var fiberBootstrap = require("../../../fiber-bootstrap"); var IOSSimulatorLogProvider = (function () { function IOSSimulatorLogProvider($iOSSimResolver, $deviceLogProvider, $devicePlatformsConstants, $processService) { this.$iOSSimResolver = $iOSSimResolver; this.$deviceLogProvider = $deviceLogProvider; this.$devicePlatformsConstants = $devicePlatformsConstants; this.$processService = $processService; } IOSSimulatorLogProvider.prototype.startLogProcess = function (deviceIdentifier) { var _this = this; if (!this.isStarted) { var deviceLogChildProcess = this.$iOSSimResolver.iOSSim.getDeviceLogProcess(deviceIdentifier); var action = function (data) { fiberBootstrap.run(function () { return _this.$deviceLogProvider.logData(data.toString(), _this.$devicePlatformsConstants.iOS, deviceIdentifier); }); }; if (deviceLogChildProcess.stdout) { deviceLogChildProcess.stdout.on("data", action); } if (deviceLogChildProcess.stderr) { deviceLogChildProcess.stderr.on("data", action); } this.$processService.attachToProcessExitSignals(this, deviceLogChildProcess.kill); this.isStarted = true; } }; return IOSSimulatorLogProvider; }()); exports.IOSSimulatorLogProvider = IOSSimulatorLogProvider; $injector.register("iOSSimulatorLogProvider", IOSSimulatorLogProvider);