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: log a warning on invalid schema validation #466

Merged
merged 1 commit into from
Jun 11, 2018
Merged

fix: log a warning on invalid schema validation #466

merged 1 commit into from
Jun 11, 2018

Conversation

brettstack
Copy link
Contributor

Issue #, if available:

Description of changes:
Log a warning on invalid schema validation.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@brettstack brettstack requested review from ombozek and ylynn June 11, 2018 17:24
@brettstack brettstack merged commit 56cbed3 into aws:develop Jun 11, 2018
brettstack added a commit that referenced this pull request Jun 11, 2018
* doc: update DESIGN.md to include an Overview and entry point for SAM (#370)

* Update DESIGN.md to include an Overview and entry point for SAM

* Updated wording in DESIGN.md based on PR feedback

* docs(example): improve microservice-http-endpoint-python3 example (#415)

* Remove unnecessary index.js"

* Moved common config to template Globals and uncomment debug log.

* Add sample payload and commands for testing.

* Rename test script as a script.

* Exit from script after command.

* Simplify use case for easier startup.

- Move table creation into template.
- Eliminates need to provide table name in every REST call.
- Fix GET with no params.
- Split test.sh script from output log.

* Address requested changes.

* doc(example): update api_backend example to use ES6 arrow function immediate return (#446)

Since this code is using ES6 we can use the short version of returning a param

* feat(event-source): add SQS as Lambda event source (#451)

* feat(cli): add lightweight transformer cli (#459)

* bug: fix ANY method ARN generation using wildcard (#449)

* fix(event-source): fix SQS Queue schema to allow intrinsic functions (#465)

* fix: log a warning on invalid schema validation (#466)
brettstack added a commit that referenced this pull request Jun 12, 2018
* doc: update DESIGN.md to include an Overview and entry point for SAM (#370)

* Update DESIGN.md to include an Overview and entry point for SAM

* Updated wording in DESIGN.md based on PR feedback

* docs(example): improve microservice-http-endpoint-python3 example (#415)

* Remove unnecessary index.js"

* Moved common config to template Globals and uncomment debug log.

* Add sample payload and commands for testing.

* Rename test script as a script.

* Exit from script after command.

* Simplify use case for easier startup.

- Move table creation into template.
- Eliminates need to provide table name in every REST call.
- Fix GET with no params.
- Split test.sh script from output log.

* Address requested changes.

* doc(example): update api_backend example to use ES6 arrow function immediate return (#446)

Since this code is using ES6 we can use the short version of returning a param

* feat(event-source): add SQS as Lambda event source (#451)

* feat(cli): add lightweight transformer cli (#459)

* bug: fix ANY method ARN generation using wildcard (#449)

* fix(event-source): fix SQS Queue schema to allow intrinsic functions (#465)

* fix: log a warning on invalid schema validation (#466)
@@ -2,6 +2,7 @@
from samtranslator.validator.validator import SamTemplateValidator
from samtranslator.model import ResourceTypeResolver, sam_resources
from samtranslator.plugins import LifeCycleEvents
import logging
Copy link
Contributor

Choose a reason for hiding this comment

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

This uses the root logger, which will log in any one using SAM to translate without a way to turn it off.

logging should be done by adding a __name__.

logger = logging.getLogger(__name__) and then log by doing logger.warning("Logging a Warning")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you send a PR? How do other consumers then turn that off?

Copy link
Contributor

Choose a reason for hiding this comment

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

https://stackoverflow.com/a/35325280

Should magically work. You can also manipulate the libraries logger too. For example, SAM CLI could then turn the SAM Translators logging on for a given level if they so wanted to.

Copy link

@fatbasstard fatbasstard Jun 13, 2018

Choose a reason for hiding this comment

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

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