I’m creating a desktop application build with Winforms in the Model-View-Presenter pattern.
Since deep logging with the specific step does not important to me as long that any exception will be catch, does is enough to log only in the presenter?
After all it contains the code that run all the other application parts…
The only downsite to limiting logging code to the presenter (as long as you handle any exceptions that happen in the models and view actions) is missed exceptions thrown by the UI. For example, say you have a
_Clickhandler that causes aNullReferenceExceptionbefore the presenter receives the event (however that is implemented). The exception could bubble through the application without being logged by the presenter. I would wrap theMainmethod in atry..catchand do some last-resort logging to catch these.