sample-code-ruby
sample-code-ruby copied to clipboard
Use logger
This PR cleans up the noisy output when running rspec. All puts and printf statements are replaced by logger.info, logger.warn or logger.error. The logger provided in each sample defaults to INFO, while the logger in the spec is ERROR only. In either case the default can be overridden by setting environment variable LOGLEVEL.
I think using Logger in SDK samples adds value in being closer to real world usage. Having clean rspec output makes it easier to identify new issues and regressions.
This is a large diff for review, but the changes are relatively simple and consistent, mostly a global search/replace of puts with logger.info.
I think the Travis build failure is an intermittent error, try re-running the job. By coincidence the output for the failed job in Travis provides a good example of showing errors only.
I forced a rebuild and it passed this time.
Updated to use SharedHelper.