caponica / AmazonMwsComplete

Name-spaced wrappers for the full set of Amazon MWS client libraries
56 stars 53 forks source link

echo calls messing up the output buffer. #21

Closed codebymikey closed 6 years ago

codebymikey commented 6 years ago

When using this library in a Symfony controller for example.

All the echo debug functions will mess up the response and output buffer especially if you're expecting a simple JSON response.

e.g. https://github.com/caponica/AmazonMwsComplete/blob/e4235f3afb4c9090242e14a8f225115b4949b9f2/src/CaponicaAmazonMwsComplete/Domain/Throttle/ThrottledRequestLogCollection.php#L46

I'd recommend using a simple Psr\Log\LoggerInterface or Monolog to handle all your logging or at least provide the ability to disable logs.

caponica commented 6 years ago

If I had the time I would love to do this :-)

You are welcome to submit a PR with a Logger implementation to improve the codebase.

caponica commented 6 years ago

Thanks for the PR. Please take a look at my comments on it.

For now I have merged it into a branch - if the changes made look sensible to you then I'll merge it into master. A couple of extra lines in README.md would be helpful too!

caponica commented 6 years ago

Changes merged into master. Thanks for your help @codebymikey !