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

Improve logging robustness #104

Merged
merged 11 commits into from
May 30, 2019
Merged

Improve logging robustness #104

merged 11 commits into from
May 30, 2019

Conversation

lextiz
Copy link
Contributor

@lextiz lextiz commented Mar 26, 2019

Do not pretty print a JSON object when serialization or serialization fail, for details see #103.

Do not pretty print a JSON object when serialization or serialization fail, for details see pact-foundation#103.
@lextiz
Copy link
Contributor Author

lextiz commented Mar 27, 2019

I am trying to do an end-to-end test, and build the executable according to instructions and have a question: which version of Ruby should be used, 2.2?

@lextiz
Copy link
Contributor Author

lextiz commented Mar 28, 2019

Hi @bethesque,

I would really appreciate a hint regarding following the packaging instructions.
After running the first step in the instructions (bundle exec rake package) with any recent Ruby version I get the following message:

You can only 'bundle install' using Ruby 2.2, because that's what Traveling Ruby uses.

When trying the same with Ruby 2.2 I get:

webrick-1.4.2 requires ruby version >= 2.3.0, which is incompatible with the current version, ruby 2.2.10p489
rake aborted!

Which version of Ruby should I use? Or am I missing something in the process?

Thanks!

@lextiz
Copy link
Contributor Author

lextiz commented Mar 29, 2019

Tested this locally (found a way to do it without packaging the executable). IMO the PR is ready, please review.

@bethesque
Copy link
Member

Firstly, please add a unit test to document this feature. No PRs will be accepted without test coverage.

Secondly, the original version of this method takes an object and returns a String. The change you have made means that it will return an object. Can you please explain this?

@lextiz
Copy link
Contributor Author

lextiz commented Apr 3, 2019

Will have a look at the unit test.
Regarding the return type: the purpose of this function is to pretty print a golang struct, when the pretty printing fails the object is returned and as far as I understand is accepted by the logger. What would you suggest instead?

@bethesque
Copy link
Member

If the method is meant to return a string, then call object.to_s.

@lextiz
Copy link
Contributor Author

lextiz commented Apr 9, 2019

@bethesque Thanks for the hint. IMO the code is ready for review.

@lextiz
Copy link
Contributor Author

lextiz commented May 9, 2019

Is there something I can do in regards to this PR?

@bethesque bethesque merged commit cfb0259 into pact-foundation:master May 30, 2019
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.

2 participants