Best approach for logging from views

jakub.gondek's Avatar


21 Oct, 2015 02:03 PM

Is there any reasonable approach to logging from views? I mean the one apart from:
- passing ILogger to view constructor, - injecting ILogger to view by [Inject] tag. The two above I consider not to handy to add or remove. Do you guys have any other ideas on the subject?

  1. Support Staff 1 Posted by Ondina D.F. on 21 Oct, 2015 03:52 PM

    Ondina D.F.'s Avatar

    Hi Jakub!

    Not sure how you'd expect to pass a logger to the view instead of the ways you've mentioned.
    There is of course the option of injecting the logger into the mediator and setting it on the view, but that's not what you're looking for, I guess.

    Concerning the removal / disabling of the logger, for example when you want to deploy a release build of your application, you can simply set the log level to zero in your context config class:

    context.logLevel = 0;

    Does that answer your question?


  2. Ondina D.F. closed this discussion on 30 Nov, 2015 04:07 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac