@@ -11,18 +11,16 @@ export class IOSLogFilter implements Mobile.IPlatformLogFilter {
1111 // Example:
1212 // 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:"
1313 // 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}` ) ;
1515
1616 private filterActive : boolean = true ;
17- private projectName : string ;
1817
1918 private partialLine : string = null ;
2019
2120 constructor (
2221 private $loggingLevels : Mobile . ILoggingLevels ,
2322 private $fs : IFileSystem ,
2423 private $projectData : IProjectData ) {
25- this . projectName = this . $projectData . projectName ;
2624 }
2725
2826 public filterData ( data : string , logLevel : string , pid ?: string ) : string {
@@ -57,7 +55,10 @@ export class IOSLogFilter implements Mobile.IPlatformLogFilter {
5755
5856 if ( matchResult && matchResult . length > 1 ) {
5957 // 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 ;
6162 }
6263
6364 if ( this . filterActive ) {
@@ -76,11 +77,11 @@ export class IOSLogFilter implements Mobile.IPlatformLogFilter {
7677 return output . length === 0 ? null : output ;
7778 }
7879
79- private preFilter ( data :string , currentLine : string ) : boolean {
80+ private preFilter ( data : string , currentLine : string ) : boolean {
8081 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 ) ;
8485 }
8586
8687 private getOriginalFileLocation ( data : string ) : string {
0 commit comments