From f77ce2fe4541f544b8bfd350b2d09ab59b3f6726 Mon Sep 17 00:00:00 2001 From: Tsvetan Raikov Date: Fri, 14 Oct 2016 16:56:11 +0300 Subject: [PATCH] Included file, row and column information in iOS log output --- lib/services/ios-log-filter.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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();