File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,13 @@ exports.builder = yargs => {
8585 implies : 'renderer' ,
8686 type : 'string' ,
8787 requiresArg : true
88+ } ,
89+ warnings : {
90+ alias : 'W' ,
91+ describe : 'Print renderer warnings to console' ,
92+ group : 'Electron' ,
93+ type : 'boolean' ,
94+ default : false
8895 }
8996 } )
9097 . check ( argv => {
@@ -190,7 +197,11 @@ exports.handler = async argv => {
190197 } )
191198 ipc . on ( 'mocha-warn' , ( _ , warning ) => warn ( warning ) )
192199
193- ipc . on ( 'console-call' , print )
200+ ipc . on ( 'console-call' , ( _ , method , args ) => {
201+ if ( method !== 'warn' || argv . warnings ) {
202+ print ( method , args )
203+ }
204+ } )
194205
195206 // Undocumented call in electron-window
196207 win . _loadURLWithArgs (
@@ -231,7 +242,7 @@ const warn = warning => {
231242 console . warn ( ansi . yellow ( `Warning: ${ warning . message } ` ) )
232243}
233244
234- const print = ( _ , method , args ) => {
245+ const print = ( method , args ) => {
235246 const output = util . format . apply ( null , args )
236247 console [ method ] ( output )
237248}
You can’t perform that action at this time.
0 commit comments