-
Notifications
You must be signed in to change notification settings - Fork 207
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
Add log-level property to config schema #2359
Add log-level property to config schema #2359
Conversation
/azp run |
…level_property_runtime_config' into dev/rubencerna/log-level_property_runtime_config Fixes comments
/azp run |
/azp run |
/azp run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just need to cleanup the GetLogLevel() function and find a better place for it to live.
…level_property_runtime_config' into dev/rubencerna/log-level_property_runtime_config
/azp run |
/azp run |
src/Service.Tests/Unittests/RuntimeConfigLoaderJsonDeserializerTests.cs
Outdated
Show resolved
Hide resolved
src/Service.Tests/Unittests/RuntimeConfigLoaderJsonDeserializerTests.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Posting comments so far
/azp run |
…level_property_runtime_config' into dev/rubencerna/log-level_property_runtime_config
/azp run |
/azp run |
/azp run |
2 similar comments
/azp run |
/azp run |
Why make this change?
Adds log-level property to dab config file under the runtime section, closing issue #1645. The log-level is necessary to receive updates from the program, and with this property, it gives the users the ability to change what type of information they receive from the program. Lastly, it allows the users to have more options on how to change the log-level property, be it through the config file or the CLI.
What is this change?
First, the log-level property was added to the config file schema, in order for the user to have the ability to add the property into their config file. In order to save the information that is inside the property, a new object model named
LogLevelOptions
was created, inside of it is a new object model namedLevel
with the purpose of showing all of the possible values in an enum type. ALogLevelOptions
was then added toRuntimeOptions
so the program knows in which section it is supposed to parse the information. A new converterLogLevelOptionsConverterFactory
was created in order to allow the property in the config file to be deserialized. The logic inStartup
file was modified to first tries to set the loggers based on the log-level property, in the case that log-level is null, it will fall back on the logic that was set up forHost Mode
. New tests were created inConfigurationTests
to test the validity of the code.How was this tested?