@@ -11,18 +11,16 @@ export class IOSLogFilter implements Mobile.IPlatformLogFilter {
11
11
// Example:
12
12
// This: "May 24 15:54:52 Dragons-iPhone NativeScript250(NativeScript)[356] <Notice>: CONSOLE ERROR file:///app/tns_modules/@angular/core/bundles/core.umd.js:3477:36: ORIGINAL STACKTRACE:"
13
13
// Becomes: CONSOLE ERROR file:///app/tns_modules/@angular /core/bundles/core.umd.js:3477:36: ORIGINAL STACKTRACE:
14
- protected infoFilterRegex = new RegExp ( `^.*(?:<Notice>:|<Error>:|<Warning>:|\\(NativeScript\\)|${ this . appOutputRegex . source } :){1}` ) ;
14
+ protected infoFilterRegex = new RegExp ( `^.*(?:<Notice>:|<Error>:|<Warning>:|\\(NativeScript\\)|${ this . appOutputRegex . source } :){1}` ) ;
15
15
16
16
private filterActive : boolean = true ;
17
- private projectName : string ;
18
17
19
18
private partialLine : string = null ;
20
19
21
20
constructor (
22
21
private $loggingLevels : Mobile . ILoggingLevels ,
23
22
private $fs : IFileSystem ,
24
23
private $projectData : IProjectData ) {
25
- this . projectName = this . $projectData . projectName ;
26
24
}
27
25
28
26
public filterData ( data : string , logLevel : string , pid ?: string ) : string {
@@ -57,7 +55,10 @@ export class IOSLogFilter implements Mobile.IPlatformLogFilter {
57
55
58
56
if ( matchResult && matchResult . length > 1 ) {
59
57
// Check if the name of the app equals the name of the CLI project and turn on the filter if not.
60
- this . filterActive = matchResult [ 1 ] !== this . projectName ;
58
+ // We call initializeProjectData in order to obtain the current project name as the instance
59
+ // of this filter may be used accross multiple projects.
60
+ this . $projectData . initializeProjectData ( ) ;
61
+ this . filterActive = matchResult [ 1 ] !== this . $projectData . projectName ;
61
62
}
62
63
63
64
if ( this . filterActive ) {
@@ -76,11 +77,11 @@ export class IOSLogFilter implements Mobile.IPlatformLogFilter {
76
77
return output . length === 0 ? null : output ;
77
78
}
78
79
79
- private preFilter ( data :string , currentLine : string ) : boolean {
80
+ private preFilter ( data : string , currentLine : string ) : boolean {
80
81
return currentLine . length < 1 ||
81
- currentLine . indexOf ( "SecTaskCopyDebugDescription" ) !== - 1 ||
82
- currentLine . indexOf ( "NativeScript loaded bundle" ) !== - 1 ||
83
- ( currentLine . indexOf ( "assertion failed:" ) !== - 1 && data . indexOf ( "libxpc.dylib" ) !== - 1 ) ;
82
+ currentLine . indexOf ( "SecTaskCopyDebugDescription" ) !== - 1 ||
83
+ currentLine . indexOf ( "NativeScript loaded bundle" ) !== - 1 ||
84
+ ( currentLine . indexOf ( "assertion failed:" ) !== - 1 && data . indexOf ( "libxpc.dylib" ) !== - 1 ) ;
84
85
}
85
86
86
87
private getOriginalFileLocation ( data : string ) : string {
0 commit comments