Liquid-Application-Framework-1.0-deprecated icon indicating copy to clipboard operation
Liquid-Application-Framework-1.0-deprecated copied to clipboard

ILightLogger violates separation of concerns

Open guilhermeluizsp opened this issue 4 years ago • 1 comments

Inside the LightController class, there's a method called Result that returns the appropriate IActionResult depending on the state of the DomainResponse passed as parameter.

https://github.com/Avanade/Liquid-Application-Framework/blob/93f7874f2ead13d3602cc39fc1e9355206217f57/src/Liquid.Activation/Controller/LightController.cs#L63-L85

This method logs the response alongside with the requested path if traffic logging is enabled

https://github.com/Avanade/Liquid-Application-Framework/blob/93f7874f2ead13d3602cc39fc1e9355206217f57/src/Liquid.Activation/Controller/LightController.cs#L72-L75

This is clearly a violation of separation of concerns since the flag is defined within the ILightLogger interface. It is not responsibility of the logger to know whether it should log the output or not. This should be a configuration for the controller.

guilhermeluizsp avatar Nov 17 '19 01:11 guilhermeluizsp