diff --git a/lib/services/ios-log-filter.ts b/lib/services/ios-log-filter.ts index 76b50b853c..2229ab3e29 100644 --- a/lib/services/ios-log-filter.ts +++ b/lib/services/ios-log-filter.ts @@ -16,14 +16,13 @@ export class IOSLogFilter implements Mobile.IPlatformLogFilter { } // CONSOLE LOG messages comme in the following form: // [pid] CONSOLE LOG file:///location:row:column: - // This code removes the first part and leaves only the message as specified by the call to console.log function. - // This removes the unnecessary information and makes the log consistent with Android. - let logIndex = data.indexOf("CONSOLE LOG"); - if (logIndex !== -1) { - let i = 4; - while(i) { logIndex = data.indexOf(':', logIndex+1); i --; } - if (logIndex > 0) { - data = "JS:" + data.substring(logIndex+1, data.length); + // This code removes unnecessary information from log messages. The output looks like: + // CONSOLE LOG file:///location:row:column: + if (pid) { + let searchString = "["+pid+"]: "; + let pidIndex = data.indexOf(searchString); + if (pidIndex > 0) { + data = data.substring(pidIndex + searchString.length, data.length); } } return data.trim();