Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 496777

Summary: Allow adapter binding warnings to be disabled
Product: [Tools] GEF Reporter: Colin Sharples <ctg>
Component: GEF CommonAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matthias.wienand
Version: 1.0.0   
Target Milestone: 4.1.0 (Neon.1) RC1   
Hardware: PC   
OS: Windows 10   
Whiteboard:

Description Colin Sharples CLA 2016-06-25 19:29:21 EDT
When parsing a module for adapter bindings, the injector prints out information and warning messages for situations where the binding information may not be accurate. As many of these messages do not mean that there is any actual problem that needs to be fixed, there should be a way of disabling the messages in a production environment in order to avoid cluttering logging/output streams.

Can an option be added to AdapterInjectionSupport to disable the messages?
Comment 1 Matthias Wienand CLA 2016-08-15 09:15:02 EDT
I added a LoggingMode enum that can be passed as a parameter to AdapterInjectionSupport, AdaptableTypeListener, and AdapterInjector upon construction. The LoggingMode determines if information and warning messages are printed or suppressed. If in LoggingMode#DEVELOPMENT, all messages are printed. If in LoggingMode#PRODUCTION, only error messages are printed.

In order to use the parameter, you can override the MvcModule#enableAdapterMapInjection() method that creates and installs (AbstractModule#install(Module)) a new AdapterInjectionSupport.

For the MVC Logo Example, as well as the Zest Graph Example, the LoggingMode#PRODUCTION is now used, so that neither information nor warning messages should be printed when starting one of these examples.

The code is published on the master branch and was ported back to R4_0_maintenance, therefore, I resolve this ticket as fixed for 5.0.0 M2 / 4.1.0 RC1.