@@ -69,13 +69,18 @@ const PatternEngines = Object.create({
69
69
// function is kind of a big deal.
70
70
enginesDirectories . forEach ( function ( engineDirectory ) {
71
71
const enginesInThisDir = findEngineModulesInDirectory ( engineDirectory . path ) ;
72
- console . log ( chalk . bold ( `Loading engines from ${ engineDirectory . displayName } ...\n` ) ) ;
72
+ if ( patternLabConfig . debug ) {
73
+ console . log ( chalk . bold ( `Loading engines from ${ engineDirectory . displayName } ...\n` ) ) ;
74
+ }
73
75
74
76
// find all engine-named things in this directory and try to load them,
75
77
// unless it's already been loaded.
76
78
enginesInThisDir . forEach ( function ( engineDiscovery ) {
77
79
let errorMessage ;
78
- const successMessage = chalk . green ( "good to go" ) ;
80
+ const successMessage = "good to go" ;
81
+ if ( patternLabConfig . debug ) {
82
+ chalk . green ( successMessage ) ;
83
+ }
79
84
80
85
try {
81
86
// Give it a try! load 'er up. But not if we already have,
@@ -96,7 +101,9 @@ const PatternEngines = Object.create({
96
101
errorMessage = err . message ;
97
102
} finally {
98
103
// report on the status of the engine, one way or another!
99
- console . log ( ` ${ engineDiscovery . name } :` , errorMessage ? chalk . red ( errorMessage ) : successMessage ) ;
104
+ if ( patternLabConfig . debug ) {
105
+ console . log ( ` ${ engineDiscovery . name } :` , errorMessage ? chalk . red ( errorMessage ) : successMessage ) ;
106
+ }
100
107
}
101
108
} ) ;
102
109
console . log ( '' ) ;
@@ -106,8 +113,9 @@ const PatternEngines = Object.create({
106
113
if ( Object . keys ( self ) . length === 0 ) {
107
114
throw new Error ( 'No engines loaded! Something is seriously wrong.' ) ;
108
115
}
109
-
110
- console . log ( chalk . bold ( 'Done loading engines.\n' ) ) ;
116
+ if ( patternLabConfig . debug ) {
117
+ console . log ( chalk . bold ( 'Done loading engines.\n' ) ) ;
118
+ }
111
119
} ,
112
120
113
121
getEngineNameForPattern : function ( pattern ) {
0 commit comments