File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,13 @@ export class IOSLogFilter implements Mobile.IPlatformLogFilter {
1616 }
1717 // CONSOLE LOG messages comme in the following form:
1818 // <date> <domain> <app>[pid] CONSOLE LOG file:///location:row:column: <actual message goes here>
19- // This code removes the first part and leaves only the message as specified by the call to console.log function.
20- // This removes the unnecessary information and makes the log consistent with Android.
21- let logIndex = data . indexOf ( "CONSOLE LOG" ) ;
22- if ( logIndex !== - 1 ) {
23- let i = 4 ;
24- while ( i ) { logIndex = data . indexOf ( ':' , logIndex + 1 ) ; i -- ; }
25- if ( logIndex > 0 ) {
26- data = "JS:" + data . substring ( logIndex + 1 , data . length ) ;
19+ // This code removes unnecessary information from log messages. The output looks like:
20+ // CONSOLE LOG file:///location:row:column: <actual message goes here>
21+ if ( pid ) {
22+ let searchString = "[" + pid + "]: " ;
23+ let pidIndex = data . indexOf ( searchString ) ;
24+ if ( pidIndex > 0 ) {
25+ data = data . substring ( pidIndex + searchString . length , data . length ) ;
2726 }
2827 }
2928 return data . trim ( ) ;
You can’t perform that action at this time.
0 commit comments