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

Switch to Tinyformat #1009

Merged
merged 5 commits into from
Mar 9, 2018

Conversation

TheCharlatan
Copy link
Contributor

This pr was inspired by laanwj's bitcoin/bitcoin#3549 and should close #440 . The initial commit from printf -> LogPrintf can be found here.

In it's current state (especially regarding commit order) it is a mess. Should I squash it into a single commit, or keep multiple commits that attempt to show the order of changes done?

The most important changes happen in util.cpp / util.h .

@tomasbrod
Copy link
Member

  • squashing is not necessary, I prefer separate commits
  • the commits should have proper authorship attached,
    • wasn't it possible to do interactive rebase?

@TheCharlatan
Copy link
Contributor Author

Could have applied singular patches from bitcoin's git, but that would have been a large amount of work, since line numbers are completely different and we have a lot of new stuff that is being logged. I'll try to figure out how to attach the authorship properly. It's a bit hard, since multiple commits do different things, e.g. LogPrintf -> LogPrint("class",...) -> allow std::string to be logged, on the same line. Obviously I do not want to do the same work 3 times over.

gavinandresen and others added 3 commits March 8, 2018 00:00
This is work done by Gavin Andresen and can be found at 881a85a in bitcoin's git tree.
Switch to tinyformat-based formatting.

Tinyformat is a typesafe drop-in replacement for C99 printf functions:
https://github.com/c42f/tinyformat

This commit contains work authored by laanwj and can be found at commit hash b77dfdc
in the bitcoin git tree.
After the tinyformat switch sprintf() family functions support passing
actual std::string objects.

Remove unnecessary c_str calls in logging and formatting.
This commit contains work authored by laanwj and can be found at commit hash 7d9d134
in the bitcoin git tree.
@TheCharlatan
Copy link
Contributor Author

Ok, much nicer now. I included the original commit message for each and then added the fixes I had to apply as a single last commit.

Convert printf to LogPrintf in Gridcoin specific source files.
Convert OutputDebugStringf to LogPrintf as well.
Fix tests to correctly output the debug.
@denravonska
Copy link
Member

I think we can remove the \r\n from all the calls now.

@TheCharlatan
Copy link
Contributor Author

Just the carriage return, or also the newline?

After the switch to tinyformat the carriage return is not really needed anymore
in the debug log strings.
@denravonska denravonska merged commit f00f1a3 into gridcoin-community:development Mar 9, 2018
denravonska added a commit that referenced this pull request May 25, 2018
Fixed
 - Fixes for displaying on high DPI displays, #517 (@skcin).
 - Re-enable unit tests, add unit test to Travis, #769, #808 (@TheCharlatan).
 - Fix empty string in sendalert2 (@tomasbrod).

Added
 - Neural Report RPC command, #1063 (@tomasbrod).
 - GUI wallet redign with new icons and purple native style (@skcin).

Changed
 - Switch to autotools and Depends from Bitcoin, #487 (@TheCharlatan).
 - Clean and update docs for new build system, remove outdated, #828 (@TheCharlatan).
 - Change estimated time to stake calculations to be more accurate, #1084 (@jamescowens).
 - Move logging to tinyformat, #1009 (@TheCharlatan).
 - Improve appcache performance, #734 (@denravonska).
 - Improve block index memory access performance, #679 (@denravonska).
 - NN fixes: clean logging, explain mag single response, move contract to ndata_nresp (@denravonska)
 - Updated translations:
    - Turkish, #771 (@confuest).
    - Chinese, #1012 (@linnaea).
 - RPC refactor: Cleaner locks, better error handling, move execute calls to straght rpc calls, #1024 (@Foggyx420).
 - Change locking primitives from Boost to STL, #1029 (@Foggyx420).

Removed
 - gridcoindiagnostic RPC call (@denravonska).
 - Galaza, #945 (@barton2526).
 - Assertion in SignSignature, #998 (@TheCharlatan).
 - Upgrade menu, #1094 (@jamescowens).
 - Acid test functions, #871 (@tomasbrod).
 - Qt4 support, #801 (@denravonska).
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.

None yet

5 participants