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

Cleaning up instances of .str().length() for logger.info() #3098

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

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