This patch does two bug fixing things and has two documentation corrections:
bug fix 1) It allows 32bit builds to write to debug.log past 2GB. I need someone to test this on bsd and win32. bug fix 2) Change GetFilesize to use stat() instead of fseek() to prevent an integer overflow that would prevent >2GB debug.logs from getting trimmed on most (any?) platforms. This function is only currently called by ShrinkDebugFile which has been updated to pass a string instead of a FILE.
documentation update) Add -logtimestamps and -printtoconsole to -? output.
This can be tested with:
dd if=/dev/zero of=debug.log bs=$((1024 * 1024)) count=2048; tail -f debug.log & bitcoind -daemon;
If logs get appended to where debug.log continues past 2GB it is working. Must be tested on a 32bit build.
debug.log should also no longer be truncated on startup as that should be left to the user. This can be tested by restarting bitcoind after the fact and ensuring it is not truncated.
The additional help output is pretty straight forward to test: is it there? :)