You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logger.error('\nERROR: missing an essential file from '+paths.source.patternlabFiles+'. Pattern Lab won\'t work without this file.\n');
108
111
109
112
// GTP: it seems increasingly naughty as we refactor to just unilaterally do this here,
@@ -129,9 +132,7 @@ class PatternLab {
129
132
130
133
setCacheBust(){
131
134
if(this.config.cacheBust){
132
-
if(this.config.debug){
133
-
console.log('setting cacheBuster value for frontend assets.');
134
-
}
135
+
logger.debug('setting cacheBuster value for frontend assets.');
135
136
this.cacheBuster=newDate().getTime();
136
137
}else{
137
138
this.cacheBuster=0;
@@ -168,8 +169,8 @@ class PatternLab {
168
169
this.userHead=headPattern.extendedTemplate;
169
170
}
170
171
catch(ex){
171
-
logger.error('\nWARNING: Could not find the user-editable header template, currently configured to be at '+path.join(this.config.paths.source.meta,'_00-head.mustache')+'. Your configured path may be incorrect (check this.config.paths.source.meta in your config file), the file may have been deleted, or it may have been left in the wrong place during a migration or update.\n');
172
-
if(this.config.debug){console.log(ex);}
172
+
logger.warning(`Could not find the user-editable header template, currently configured to be at ${path.join(this.config.paths.source.meta,'_00-head.ext')}. Your configured path may be incorrect (check this.config.paths.source.meta in your config file), the file may have been deleted, or it may have been left in the wrong place during a migration or update.`);
173
+
logger.warning(ex);
173
174
174
175
// GTP: it seems increasingly naughty as we refactor to just unilaterally do this here,
175
176
// but whatever. For now.
@@ -191,8 +192,8 @@ class PatternLab {
191
192
this.userFoot=footPattern.extendedTemplate;
192
193
}
193
194
catch(ex){
194
-
logger.error('\nWARNING: Could not find the user-editable footer template, currently configured to be at '+path.join(this.config.paths.source.meta,'_01-foot.mustache')+'. Your configured path may be incorrect (check this.config.paths.source.meta in your config file), the file may have been deleted, or it may have been left in the wrong place during a migration or update.\n');
195
-
if(this.config.debug){console.log(ex);}
195
+
logger.error(`Could not find the user-editable footer template, currently configured to be at ${path.join(this.config.paths.source.meta,'_01-foot.ext')}. Your configured path may be incorrect (check this.config.paths.source.meta in your config file), the file may have been deleted, or it may have been left in the wrong place during a migration or update.`);
196
+
logger.warning(ex);
196
197
197
198
// GTP: it seems increasingly naughty as we refactor to just unilaterally do this here,
198
199
// but whatever. For now.
@@ -207,7 +208,7 @@ class PatternLab {
207
208
returnthis.package.version;
208
209
}
209
210
logVersion(){
210
-
console.log(this.package.version);
211
+
logger.info(this.package.version);
211
212
}
212
213
getSupportedTemplateExtensions(){
213
214
returnthis.engines.getSupportedFileExtensions();
@@ -258,22 +259,22 @@ class PatternLab {
258
259
// handle the legacy value, which is boolean
259
260
if(typeoflogLevel==='boolean'){
260
261
if(logLevel){
261
-
logger.log.on('debug',msg=>console.log(msg));
262
+
logger.log.on('debug',msg=>console.info(msg));
262
263
}
263
-
logger.log.on('info',msg=>console.log(msg));
264
-
logger.log.on('warning',msg=>console.log(msg));
265
-
logger.log.on('error',msg=>console.log(msg));
264
+
logger.log.on('info',msg=>console.info(msg));
265
+
logger.log.on('warning',msg=>console.info(msg));
266
+
logger.log.on('error',msg=>console.info(msg));
266
267
}else{
267
268
if(logLevel==='quiet'){return;}
268
269
switch(logLevel){
269
270
case'debug':
270
-
logger.log.on('debug',msg=>console.log(msg));
271
+
logger.log.on('debug',msg=>console.info(msg));
271
272
case'info':
272
-
logger.log.on('info',msg=>console.log(msg));
273
+
logger.log.on('info',msg=>console.info(msg));
273
274
case'warning':
274
-
logger.log.on('warning',msg=>console.log(msg));
275
+
logger.log.on('warning',msg=>console.info(msg));
275
276
case'error':
276
-
logger.log.on('error',msg=>console.log(msg));
277
+
logger.log.on('error',msg=>console.info(msg));
277
278
}
278
279
}
279
280
}
@@ -305,7 +306,7 @@ function processAllPatternsIterative(patterns_dir, patternlab) {
305
306
(err,file)=>{
306
307
//log any errors
307
308
if(err){
308
-
console.log('error in processAllPatternsIterative():',err);
309
+
logger.info('error in processAllPatternsIterative():',err);
309
310
return;
310
311
}
311
312
@@ -341,7 +342,7 @@ function processAllPatternsRecursive(patterns_dir, patternlab) {
0 commit comments