Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to have configurable, global defaults #6

Open
dneimke opened this issue Oct 31, 2017 · 0 comments
Open

Provide a way to have configurable, global defaults #6

dneimke opened this issue Oct 31, 2017 · 0 comments

Comments

@dneimke
Copy link
Owner

dneimke commented Oct 31, 2017

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant