File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,15 +151,12 @@ declare global {
151151 ) : Mobile . IAndroidDeviceHashService ;
152152 }
153153
154- /**
155- * Describes log stream options
156- */
157154 /**
158155 * A structured unified logging (os_log) entry.
159156 */
160157 interface IiOSLogEntry {
161158 /**
162- * Together with the thread, tells apart messages logged at the same time .
159+ * Scopes the ids of split messages, which are only unique per process .
163160 */
164161 pid ?: number ;
165162 thread ?: number ;
@@ -175,6 +172,9 @@ declare global {
175172 message : string ;
176173 }
177174
175+ /**
176+ * Describes log stream options
177+ */
178178 interface IiOSLogStreamOptions {
179179 /**
180180 * This is the --predicate option which will be passed to `log stream` command
@@ -1369,12 +1369,8 @@ declare global {
13691369
13701370 /**
13711371 * Streams structured logs of the process with the given executable name.
1372- * Returns false when the installed ios-device-lib cannot stream them.
13731372 */
1374- startDeviceLogStream (
1375- deviceIdentifier : string ,
1376- processName : string ,
1377- ) : boolean ;
1373+ startDeviceLogStream ( deviceIdentifier : string , processName : string ) : void ;
13781374
13791375 apps (
13801376 deviceIdentifiers : string [ ] ,
Original file line number Diff line number Diff line change @@ -139,12 +139,8 @@ export class IOSDeviceOperations
139139 public startDeviceLogStream (
140140 deviceIdentifier : string ,
141141 processName : string ,
142- ) : boolean {
142+ ) : void {
143143 this . assertIsInitialized ( ) ;
144- if ( typeof this . deviceLib . startDeviceLogStream !== "function" ) {
145- return false ;
146- }
147-
148144 this . setShouldDispose ( false ) ;
149145 this . $logger . trace (
150146 `Streaming structured logs of ${ processName } on device with identifier: ${ deviceIdentifier } .` ,
@@ -155,7 +151,6 @@ export class IOSDeviceOperations
155151 this . deviceLib . startDeviceLogStream ( [
156152 { deviceId : deviceIdentifier , processName } ,
157153 ] ) ;
158- return true ;
159154 }
160155
161156 public async apps (
Original file line number Diff line number Diff line change @@ -99,30 +99,23 @@ export class IOSDevice extends IOSDeviceBase {
9999 const processName = this . $deviceLogProvider . getProjectNameForDevice (
100100 this . deviceInfo . identifier ,
101101 ) ;
102- if ( processName && this . startStructuredDeviceLog ( processName ) ) {
103- return ;
102+ if ( processName ) {
103+ this . startStructuredDeviceLog ( processName ) ;
104+ } else {
105+ this . startSyslogDeviceLog ( ) ;
104106 }
105-
106- this . startSyslogDeviceLog ( ) ;
107107 }
108108
109- private startStructuredDeviceLog ( processName : string ) : boolean {
109+ private startStructuredDeviceLog ( processName : string ) : void {
110110 this . _deviceLogEntryHandler = this . actionOnDeviceLogEntry . bind ( this ) ;
111111 this . $iosDeviceOperations . on (
112112 commonConstants . DEVICE_LOG_ENTRY_EVENT_NAME ,
113113 this . _deviceLogEntryHandler ,
114114 ) ;
115- if (
116- this . $iosDeviceOperations . startDeviceLogStream (
117- this . deviceInfo . identifier ,
118- processName ,
119- )
120- ) {
121- return true ;
122- }
123-
124- this . removeDeviceLogEntryHandler ( ) ;
125- return false ;
115+ this . $iosDeviceOperations . startDeviceLogStream (
116+ this . deviceInfo . identifier ,
117+ processName ,
118+ ) ;
126119 }
127120
128121 private startSyslogDeviceLog ( ) : void {
You can’t perform that action at this time.
0 commit comments