Skip to content

Commit f51583e

Browse files
author
Kristian D. Dimitrov
committed
Fix comments for iOS11 Simulator log.
1 parent d35643a commit f51583e

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/services/ios-log-filter.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class IOSLogFilter extends iOSLogFilterBase.IOSLogFilter implements Mobil
1616

1717
public filterData(data: string, logLevel: string, pid?: string): string {
1818
data = super.filterData(data, logLevel, pid);
19-
if (pid && data && data.search(new RegExp(`[\\[\\s]${pid}[\\]\\s]`)) === -1) {
19+
if (pid && data && data.indexOf(`[${pid}]`) === -1) {
2020
return null;
2121
}
2222

@@ -41,10 +41,8 @@ export class IOSLogFilter extends iOSLogFilterBase.IOSLogFilter implements Mobil
4141
// This code removes unnecessary information from log messages. The output looks like:
4242
// CONSOLE LOG file:///location:row:column: <actual message goes here>
4343
if (pid) {
44-
const pidIndex = line.indexOf(`[${pid}]`);
45-
const ios11PidIndex = line.indexOf(` ${pid} `);
46-
if (pidIndex > 0 || ios11PidIndex > 0) {
47-
const pidRegex = new RegExp(`.*[\\[\\s]{1}${pid}[\\s\\]]{1}.*?:(?:.*?\\(NativeScript\\) )*`);
44+
if (line.indexOf(`[${pid}]: `) !== -1) {
45+
const pidRegex = new RegExp(`.*[\\[]{1}${pid}[\\]]{1}(?::\\s(:?\\(NativeScript\\)\\s)*)`);
4846
line = line.replace(pidRegex, "").trim();
4947
this.getOriginalFileLocation(line);
5048
result += this.getOriginalFileLocation(line) + "\n";

0 commit comments

Comments
 (0)