@@ -196,6 +196,7 @@ export class ArduinoApp {
196196 * manages the build state.
197197 * @param buildMode See build()
198198 * @param buildDir See build()
199+ * @see https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc
199200 */
200201 public async _build ( buildMode : BuildMode , compile : boolean , buildDir ?: string ) : Promise < boolean > {
201202 const dc = DeviceContext . getInstance ( ) ;
@@ -315,7 +316,10 @@ export class ArduinoApp {
315316 }
316317
317318 // We always build verbosely but filter the output based on the settings
318- args . push ( "--verbose" ) ;
319+ args . push ( "--verbose-build" ) ;
320+ if ( verbose ) {
321+ args . push ( "--verbose-upload" ) ;
322+ }
319323
320324 await vscode . workspace . saveAll ( false ) ;
321325
@@ -377,12 +381,31 @@ export class ArduinoApp {
377381 const stderrcb = ( line : string ) => {
378382 if ( os . platform ( ) === "win32" ) {
379383 line = line . trim ( ) ;
380- if ( line . length && ! line . startsWith ( "DEBUG " ) && ! line . startsWith ( "TRACE " ) && ! line . startsWith ( "INFO " ) ) {
381- arduinoChannel . channel . append ( `${ line } ${ os . EOL } ` ) ;
384+ if ( line . length <= 0 ) {
385+ return ;
386+ }
387+ line = `${ line } ${ os . EOL } ` ;
388+ }
389+ if ( ! verbose ) {
390+ // Don't spill log with spurious info from the backend
391+ // This list could be fetched from a config file to
392+ // accommodate messages of unknown board packages, newer
393+ // backend revisions etc.
394+ const filters = [
395+ / ^ P i c k e d \s u p \s J A V A _ T O O L _ O P T I O N S : \s + / ,
396+ / ^ \d + \d + - \d + - \d + T \d + : \d + : \d + .\d + Z \s I N F O \s / ,
397+ / ^ \d + \d + - \d + - \d + T \d + : \d + : \d + .\d + Z \s W A R N \s / ,
398+ / ^ D E B U G \s + / ,
399+ / ^ T R A C E \s + / ,
400+ / ^ I N F O \s + / ,
401+ ] ;
402+ for ( const f of filters ) {
403+ if ( line . match ( f ) ) {
404+ return ;
405+ }
382406 }
383- } else {
384- arduinoChannel . channel . append ( line ) ;
385407 }
408+ arduinoChannel . channel . append ( line ) ;
386409 }
387410
388411 return await util . spawn (
0 commit comments