Skip to content

Conversation

@AnikaAChowdhury
Copy link

@AnikaAChowdhury AnikaAChowdhury commented Jan 29, 2022

Submission Checklist

  • Run unit tests: ./runTests.py src/test/unit
  • Run cpplint: make cpplint
  • Declare copyright holder and open-source license: see below

Summary

This fixes #2577 which is cleaning up code instances that has .str().length() for logger.info(). This cleans up a lot of "if (msg.str().length() > 0)" instances from the code block that follows
if (msg.str().length() > 0)
logger.info(msg);
patterns. However, there are still a lot of instances "if (msg.str().length() > 0)" left because it was connected with another logger implementation beside logger.info(). Therefore, some of the instances of that could not be removed. There were some left in writer.hpp which was not removed. If needed, it could be removed.

Intended Effect

Removes a lot of duplicate codes.

How to Verify

Need to run tests on the existing testing library (In Progress).

Side Effects

Followed @WardBrian's suggestions

Documentation

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

@AnikaAChowdhury
Copy link
Author

Hi! I am not sure why the test failed because logger.call_count() not returning the correct count?

@WardBrian
Copy link
Member

@rok-cesnovar are you able to help with the test failure here?

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.

Clean up code: .str().length()

3 participants