Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve iOS log filter regex. #3079

Merged
merged 1 commit into from
Aug 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/common
2 changes: 1 addition & 1 deletion lib/services/ios-log-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { cache } from "../common/decorators";
import * as iOSLogFilterBase from "../common/mobile/ios/ios-log-filter";

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

private partialLine: string = null;

Expand Down
4 changes: 4 additions & 0 deletions test/services/ios-log-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ describe("iOSLogFilter", () => {
"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",
" 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",
" 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",
"Aug 22 10:59:20 MCSOFAPPBLD TestApp[52946]: CONSOLE LOG file:///app/home/home-view-model.js:6:20: CUSTOM CONSOLE LOG",
""
],
infoExpectedArr: [
Expand All @@ -43,6 +44,7 @@ describe("iOSLogFilter", () => {
null,
null,
"CONSOLE ERROR file:///app/tns_modules/@angular/core/bundles/core.umd.js:3472:32: EXCEPTION: Uncaught (in promise): Error: CUSTOM EXCEPTION",
"CONSOLE LOG file:///app/home/home-view-model.js:6:20: CUSTOM CONSOLE LOG",
""
]
},
Expand All @@ -65,6 +67,7 @@ describe("iOSLogFilter", () => {
"UIApplicationMain@[native code]",
"start@file:///app/tns_modules/tns-core-modules/application/application.js:251:26",
"bootstrapApp@file:///app/tns_module",
"Aug 22 10:59:20 MCSOFAPPBLD TestApp[52946]: CONSOLE LOG file:///app/home/home-view-model.js:6:20: CUSTOM CONSOLE LOG",
""
],
infoExpectedArr: [
Expand All @@ -84,6 +87,7 @@ describe("iOSLogFilter", () => {
null,
null,
null,
"CONSOLE LOG file:///app/home/home-view-model.js:6:20: CUSTOM CONSOLE LOG",
""
]
}
Expand Down