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 a CLI option to control logging level #1000

Merged
merged 2 commits into from
Sep 13, 2018

Conversation

ackintosh
Copy link
Contributor

@ackintosh ackintosh commented Sep 9, 2018

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.3.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

closes #989

This PR makes logging level controllable with the property as below.

$ java -Dlog.level=error ....

@ackintosh ackintosh changed the title Add CLI option to control logging level Add a CLI option to control logging level Sep 9, 2018
@ackintosh
Copy link
Contributor Author

#1000 👀

@ackintosh
Copy link
Contributor Author

This PR is not targeting a particular programming language.
cc @OpenAPITools/generator-core-team @OpenAPITools/openapi-generator-collaborators

@wing328
Copy link
Member

wing328 commented Sep 10, 2018

@ackintosh thanks for the enhancement, which definitely makes it easier to debug OpenAPI Generator (in addition to providing a configuration file)

Instead of using log_level, may I suggest naming the system property as log.level instead as it seems to be more common to use dots instead of underscores in system property? (but I couldn't find any official style guide for naming system properties)

Let's see if others have comments on this as well.

@jimschubert
Copy link
Member

I agree that it's probably better as log.level so other logger implementations that we might not be wrapping could pick this up.

@ackintosh
Copy link
Contributor Author

Thanks for the suggestion. It looks better to me as well. ✨

@ackintosh
Copy link
Contributor Author

I've updated the property name. Please have a look when you have time.

Copy link
Member

@wing328 wing328 left a comment

Choose a reason for hiding this comment

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

LGTM

@ackintosh ackintosh merged commit 9a19a06 into OpenAPITools:master Sep 13, 2018
@ackintosh ackintosh deleted the log-level branch September 13, 2018 12:54
jaumard pushed a commit to jaumard/openapi-generator that referenced this pull request Sep 21, 2018
* Add CLI option to control logging level

* Update the property name
A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
* Add CLI option to control logging level

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

Successfully merging this pull request may close these issues.

CLI option to control logging level
3 participants