Conditionally Disable Logging

Apr 14, 2011 at 3:09 PM

Jounce allows for overriding the default logger which works great.  But in some situations, I need to be able to conditionally disable logging.  In other words, under normal circumstances the application runs without logging, but when the user begins to encounter an error, I would allow them to enable logging.  My suggestion would be one of the following:

  • Add a None option to the LogSeverity enumeration so that when set, you could take action accordingly in the custom logger.
  • Add an InitParam Jounce.LogEnabled that would allow for disabling logging.
  • Modify the ILogger interface to include a status for enabled (this would be a breaking change).

There are probably some better approaches to this, but those are my initial thoughts.