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

Add log-level property to config schema #2359

Merged
merged 18 commits into from
Sep 12, 2024

Conversation

RubenCerna2079
Copy link
Contributor

@RubenCerna2079 RubenCerna2079 commented Sep 4, 2024

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 named Level with the purpose of showing all of the possible values in an enum type. A LogLevelOptions was then added to RuntimeOptions so the program knows in which section it is supposed to parse the information. A new converter LogLevelOptionsConverterFactory was created in order to allow the property in the config file to be deserialized. The logic in Startup 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 for Host Mode. New tests were created in ConfigurationTests to test the validity of the code.

How was this tested?

  • Integration Tests
  • Unit Tests

@RubenCerna2079
Copy link
Contributor Author

/azp run

@RubenCerna2079
Copy link
Contributor Author

/azp run

@RubenCerna2079
Copy link
Contributor Author

/azp run

@RubenCerna2079 RubenCerna2079 linked an issue Sep 6, 2024 that may be closed by this pull request
@aaronburtle aaronburtle added the config changes related to config label Sep 6, 2024
@aaronburtle aaronburtle added this to the 1.3 milestone Sep 6, 2024
@RubenCerna2079
Copy link
Contributor Author

/azp run

src/Service/Startup.cs Outdated Show resolved Hide resolved
src/Config/ObjectModel/RuntimeConfig.cs Outdated Show resolved Hide resolved
src/Config/ObjectModel/RuntimeConfig.cs Outdated Show resolved Hide resolved
src/Service/Startup.cs Outdated Show resolved Hide resolved
Copy link
Contributor

@aaronburtle aaronburtle left a 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.

@RubenCerna2079
Copy link
Contributor Author

/azp run

@RubenCerna2079
Copy link
Contributor Author

/azp run

Copy link
Contributor

@Aniruddh25 Aniruddh25 left a 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

src/Config/ObjectModel/LogLevelOptions.cs Show resolved Hide resolved
src/Service/Startup.cs Outdated Show resolved Hide resolved
src/Config/ObjectModel/RuntimeOptions.cs Outdated Show resolved Hide resolved
@RubenCerna2079
Copy link
Contributor Author

/azp run

Ruben Cerna added 2 commits September 11, 2024 14:29
…level_property_runtime_config' into dev/rubencerna/log-level_property_runtime_config
@RubenCerna2079
Copy link
Contributor Author

/azp run

@RubenCerna2079
Copy link
Contributor Author

/azp run

@RubenCerna2079
Copy link
Contributor Author

/azp run

2 similar comments
@RubenCerna2079
Copy link
Contributor Author

/azp run

@RubenCerna2079
Copy link
Contributor Author

/azp run

@RubenCerna2079 RubenCerna2079 merged commit 37222f1 into main Sep 12, 2024
7 checks passed
@RubenCerna2079 RubenCerna2079 deleted the dev/rubencerna/log-level_property_runtime_config branch September 12, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config changes related to config
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add log-level property to runtime config schema
5 participants