Skip to content

[Cherry pick] Remove redundant logging of found config file #1670

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

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

Aniruddh25
Copy link
Contributor

Cherry picking #1669

Original description:

Why make this change?

What is this change?

  • Store the environment based config file name found at construction time in the property ConfigFileName.
  • Remove Console writeline statements while checking for existence of file since this leads to multiple logs - one from CLI before starting the engine and second from within the engine itself when calling TryPargeConfig
  • Add a single log of the loaded file in CLI

How was this tested?

  • Manually, using the start command of CLI as well as triggering the engine directly with argument: --ConfigFileName
  1. Starting with default config:
    Before:
    image

After:
image

  1. Starting with user provided config:
    Before:
    image

After:
image

  1. Trying to start with missing file name - same behvior as before
    image

- With the overhaul of config system PR #1402 , we started seeing
redundant logs about which config file is being used.

- Store the environment based config file name found at construction
time in the property `ConfigFileName`.
- Remove Console writeline statements while checking for existence of
file since this leads to multiple logs - one from CLI before starting
the engine and second from within the engine itself when calling
TryPargeConfig
- Add a single log of the loaded file in CLI
- Also catch exception for incorrect connection string parsing

- Manually, using the `start` command of CLI as well as triggering the
engine directly with argument: `--ConfigFileName`

1. Starting with default config:
**Before**:

![image](https://github.com/Azure/data-api-builder/assets/3513779/a29d4aff-19db-49c7-a745-b6bbdb5c62cc)

**After**:

![image](https://github.com/Azure/data-api-builder/assets/3513779/62f65222-de59-4525-b0b1-ead407d43b4e)

2. Starting with user provided config:
**Before**:

![image](https://github.com/Azure/data-api-builder/assets/3513779/b762c873-ade6-47bb-b094-44960176d90f)

**After**:

![image](https://github.com/Azure/data-api-builder/assets/3513779/2f977a72-bfdf-43fb-9cc9-806ea717b546)

3. Trying to start with missing file name - same behvior as before

![image](https://github.com/Azure/data-api-builder/assets/3513779/5a80f62e-8a06-4e7c-aa22-c120dade6801)
@Aniruddh25 Aniruddh25 disabled auto-merge August 30, 2023 18:37
@Aniruddh25 Aniruddh25 merged commit 0aebfe2 into release/0.8 Aug 30, 2023
@Aniruddh25 Aniruddh25 deleted the cherryPickLogging branch August 30, 2023 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants