UNPKG

appium-ios-device

Version:
33 lines 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SYSLOG_SERVICE_NAME = exports.SyslogService = void 0; const syslog_decoder_1 = require("./transformer/syslog-decoder"); const constants_1 = require("../constants"); const base_service_1 = require("../base-service"); //We just need to write any data to the client. It doesn't matter what we send const SYSLOG_SERVICE_NAME = 'com.apple.syslog_relay'; exports.SYSLOG_SERVICE_NAME = SYSLOG_SERVICE_NAME; const START_MESSAGE = 'start'; class SyslogService extends base_service_1.BaseServiceSocket { constructor(socketClient) { super(socketClient); this._decoder = new syslog_decoder_1.SyslogDecoder(5 * constants_1.KB); this._socketClient.pipe(this._decoder); this._assignClientFailureHandlers(this._decoder); } /** The callback function which will be called during log listening * @callback LogCallback * @param {string} log The log that is sent from the phone */ /** * Start receiving logs from the phone. The callback when a log is received * @param {LogCallback} onData */ start(onData) { this._decoder.on('data', onData); this._socketClient.write(START_MESSAGE); } } exports.SyslogService = SyslogService; exports.default = SyslogService; //# sourceMappingURL=index.js.map