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

fix: Support multiple --logger flags #704

Merged
merged 3 commits into from
Aug 2, 2022

Conversation

orpheuslummis
Copy link
Contributor

@orpheuslummis orpheuslummis commented Aug 1, 2022

Relevant issue(s)

Resolves #699

Description

Support multiple --logger flags

Tasks

  • I made sure the code is well commented, particularly hard-to-understand areas.
  • I made sure the repository-held documentation is changed accordingly.
  • I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in tools/configs/chglog/config.yml).
  • I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ...

How has this been tested?

Manual

Specify the platform(s) on which this was tested:

  • MacOS

@orpheuslummis orpheuslummis added action/no-benchmark Skips the action that runs the benchmark. area/cli Related to the CLI binary labels Aug 1, 2022
@orpheuslummis orpheuslummis self-assigned this Aug 1, 2022
Copy link
Member

@jsimnz jsimnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked up the docs to support this while working on it. Meant to do it once I got the one working, thanks for taking care of.

LGTM

Copy link
Collaborator

@fredcarle fredcarle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just one non-blocking suggesting.

cli/cli.go Outdated Show resolved Hide resolved
cli/cli.go Show resolved Hide resolved
cli/root.go Outdated
"Named logger parameter override. usage: --logger <name>,level=<level>,output=<output>,...",
rootCmd.PersistentFlags().StringArray(
"logger", []string{},
"Named logger parameter override. Usage: --logger <name>,level=<level>,output=<output>,...",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Perhaps similar to fred's suggestion to above we can make it clear that can specify multiple --logger flags in Usage section.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen Shot 2022-08-02 at 08 48 01

I've changed slightly the text. By default, cobra indicates the expected type (here stringArray ...), so there is the information for the user. Because of these two reasons, I suggest that it is sufficiently clear that it can be used multiple times.

That said I'm not satisfied with the type name that is shown as it could be clearer.

Copy link
Member

@shahzadlone shahzadlone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestions. Otherwise LGTM!

@orpheuslummis orpheuslummis force-pushed the orpheus/fix/multiple-logger-cli branch from 8221578 to 3e59adf Compare August 2, 2022 17:31
@orpheuslummis orpheuslummis merged commit b17b020 into develop Aug 2, 2022
@orpheuslummis orpheuslummis deleted the orpheus/fix/multiple-logger-cli branch August 2, 2022 17:43
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/no-benchmark Skips the action that runs the benchmark. area/cli Related to the CLI binary
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only last flag of --logger is considered by CLI
4 participants