private void reportWarnings ( ) { ImmutableList < SoyError > warnings = errorReporter . getWarnings ( ) ; if ( warnings . isEmpty ( ) ) { return ; } // this is a custom feature used by the integration test suite. if ( generalOptions . getExperimentalFeatures ( ) . contains ( "testonly_throw_on_warnings" ) ) { errorReporter = null ; throw new SoyCompilationException ( warnings ) ; } String formatted = SoyErrors . formatErrors ( warnings ) ; if ( warningSink != null ) { try { warningSink . append ( formatted ) ; } catch ( IOException ioe ) { System . err . println ( "error while printing warnings" ) ; ioe . printStackTrace ( ) ; } } else { logger . warning ( formatted ) ; } }
Reports warnings ot the user configured warning sink . Should be called at the end of successful compiles .