@@ -7,6 +7,7 @@ const _ = require('lodash');
7
7
const lh = require ( './lineage_hunter' ) ;
8
8
const Pattern = require ( './object_factory' ) . Pattern ;
9
9
const path = require ( 'path' ) ;
10
+ const logger = require ( './log' ) ;
10
11
const lineage_hunter = new lh ( ) ;
11
12
const changes_hunter = new ch ( ) ;
12
13
@@ -29,17 +30,15 @@ pseudopattern_hunter.prototype.find_pseudopatterns = function (currentPattern, p
29
30
30
31
if ( pseudoPatterns . length > 0 ) {
31
32
for ( let i = 0 ; i < pseudoPatterns . length ; i ++ ) {
32
- if ( patternlab . config . debug ) {
33
- console . log ( 'found pseudoPattern variant of ' + currentPattern . patternPartial ) ;
34
- }
33
+ logger . debug ( `Found pseudoPattern variant of ${ currentPattern . patternPartial } ` ) ;
35
34
36
35
//we want to do everything we normally would here, except instead read the pseudoPattern data
37
36
try {
38
37
var variantFileFullPath = path . resolve ( paths . source . patterns , pseudoPatterns [ i ] ) ;
39
38
var variantFileData = fs . readJSONSync ( variantFileFullPath ) ;
40
39
} catch ( err ) {
41
- console . log ( ' There was an error parsing pseudopattern JSON for ' + currentPattern . relPath ) ;
42
- console . log ( err ) ;
40
+ logger . warning ( ` There was an error parsing pseudopattern JSON for ${ currentPattern . relPath } ` ) ;
41
+ logger . warning ( err ) ;
43
42
}
44
43
45
44
//extend any existing data with variant data
@@ -84,8 +83,8 @@ pseudopattern_hunter.prototype.find_pseudopatterns = function (currentPattern, p
84
83
var variantFileFullPath = path . resolve ( paths . source . patterns , pseudoPatterns [ i ] ) ;
85
84
var variantFileData = fs . readJSONSync ( variantFileFullPath ) ;
86
85
} catch ( err ) {
87
- console . log ( ' There was an error parsing pseudopattern JSON for ' + currentPattern . relPath ) ;
88
- console . log ( err ) ;
86
+ logger . warning ( ` There was an error parsing pseudopattern JSON for ${ currentPattern . relPath } ` ) ;
87
+ logger . warning ( err ) ;
89
88
}
90
89
91
90
//extend any existing data with variant data
0 commit comments