You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By forcing developers to configure certain standard properties every time a CodeTimer is created, creates excessive noise and rework.
Properties which should have global defaults are:
Verbose - for example, you might want verbose logging in development and test, but Non-Verbose in production
ExpectedMilliseconds - this may differ from method to method, but for the vast majority of the time, it will be the same
LoggingLevel is another thing which is hard-coded. A user might want to configure the SuccessLevel and the FailureLevel to something other than Information and Warning
Finally, and this is could come later.. IPerformanceTimer and ILogFormatter could be set at a global level for anybody who wasn't using the out of the box defaults.
What I need some guidance on is how to implement a global, configurable set of defaults for a library such as this. Would it be done using some middleware which reads from IConfiguration and sets a CodeTimer.Defaults static which then gets read throughout the app? What reference implementations could I view which implement something similar?
The text was updated successfully, but these errors were encountered:
By forcing developers to configure certain standard properties every time a CodeTimer is created, creates excessive noise and rework.
Properties which should have global defaults are:
LoggingLevel is another thing which is hard-coded. A user might want to configure the SuccessLevel and the FailureLevel to something other than Information and Warning
Finally, and this is could come later.. IPerformanceTimer and ILogFormatter could be set at a global level for anybody who wasn't using the out of the box defaults.
What I need some guidance on is how to implement a global, configurable set of defaults for a library such as this. Would it be done using some middleware which reads from IConfiguration and sets a CodeTimer.Defaults static which then gets read throughout the app? What reference implementations could I view which implement something similar?
The text was updated successfully, but these errors were encountered: