flask-expects-json
flask-expects-json copied to clipboard
Logging validation errors
@Fischerfredl any chance to merge this? Thanks!
Hi @tzachyrm,
thank you for your pull request.
To incorporate logging, i would like to conform to standard logging practices.
See:
- https://docs.python.org/3/howto/logging.html
- Specifically https://docs.python.org/3/howto/logging.html#advanced-logging-tutorial
- and https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library
- https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library
I propose the following changes
- [ ] Leave the function interface as is
- [ ] create a logger based on
__name__
- [ ] Use a fixed log level for logging
- I'd consider failing validation and decoding as "events that occur during normal operation of a program" so info or debug would be more appropriate
- [ ] document logging in README.md
- [ ] Nice to have: tests
With those changes I wouldn't see a reason not to merge this.