sample-code-ruby icon indicating copy to clipboard operation
sample-code-ruby copied to clipboard

Use logger

Open varyonic opened this issue 6 years ago • 3 comments

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.

varyonic avatar May 11 '18 15:05 varyonic

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.

varyonic avatar May 11 '18 17:05 varyonic

I forced a rebuild and it passed this time.

varyonic avatar May 14 '18 16:05 varyonic

Updated to use SharedHelper.

varyonic avatar Jun 01 '18 15:06 varyonic