Skip to content

Commit 74180db

Browse files
committed
Improve iOS log filter regex.
1 parent 5fc07a7 commit 74180db

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

lib/services/ios-log-filter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { cache } from "../common/decorators";
44
import * as iOSLogFilterBase from "../common/mobile/ios/ios-log-filter";
55

66
export class IOSLogFilter extends iOSLogFilterBase.IOSLogFilter implements Mobile.IPlatformLogFilter {
7-
protected infoFilterRegex = /^.*?(<Notice>:.*?(((?:CONSOLE|JS) (?:LOG|ERROR)).*?))$/im;
7+
protected infoFilterRegex = /^.*?((?:<Notice>:)?.*?(((?:CONSOLE|JS) (?:LOG|ERROR)).*?))$/im;
88

99
private partialLine: string = null;
1010

test/services/ios-log-filter.ts

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ describe("iOSLogFilter", () => {
3232
"May 24 14:44:59 iPad-90 mobile_installation_proxy[355] <Error>: 0x1f197000 LoadInfoPlist: Failed to create CFBundle from URL file:///private/var/mobile/Containers/Bundle/Application/0DA02818-DCAE-407C-979D-D55F4F36F8D2/NativeScript300.app",
3333
" May 24 14:44:59 iPad-90 mobile_installation_proxy[355] <Error>: 0x1f197000 LoadInfoPlist: Failed to create CFBundle from URL file:///private/var/mobile/Containers/Bundle/Application/B0EE9362-7BDD-4FF2-868F-857B76D9D8D3/Cordova370.app",
3434
" May 24 14:44:59 iPad-90 NativeScript250[790] <Notice>: CONSOLE ERROR file:///app/tns_modules/@angular/core/bundles/core.umd.js:3472:32: EXCEPTION: Uncaught (in promise): Error: CUSTOM EXCEPTION",
35+
"Aug 22 10:59:20 MCSOFAPPBLD TestApp[52946]: CONSOLE LOG file:///app/home/home-view-model.js:6:20: CUSTOM CONSOLE LOG",
3536
""
3637
],
3738
infoExpectedArr: [
@@ -43,6 +44,7 @@ describe("iOSLogFilter", () => {
4344
null,
4445
null,
4546
"CONSOLE ERROR file:///app/tns_modules/@angular/core/bundles/core.umd.js:3472:32: EXCEPTION: Uncaught (in promise): Error: CUSTOM EXCEPTION",
47+
"CONSOLE LOG file:///app/home/home-view-model.js:6:20: CUSTOM CONSOLE LOG",
4648
""
4749
]
4850
},
@@ -65,6 +67,7 @@ describe("iOSLogFilter", () => {
6567
"UIApplicationMain@[native code]",
6668
"start@file:///app/tns_modules/tns-core-modules/application/application.js:251:26",
6769
"bootstrapApp@file:///app/tns_module",
70+
"Aug 22 10:59:20 MCSOFAPPBLD TestApp[52946]: CONSOLE LOG file:///app/home/home-view-model.js:6:20: CUSTOM CONSOLE LOG",
6871
""
6972
],
7073
infoExpectedArr: [
@@ -84,6 +87,7 @@ describe("iOSLogFilter", () => {
8487
null,
8588
null,
8689
null,
90+
"CONSOLE LOG file:///app/home/home-view-model.js:6:20: CUSTOM CONSOLE LOG",
8791
""
8892
]
8993
}

0 commit comments

Comments
 (0)