forked from electronicarts/CnC_Generals_Zero_Hour
-
Notifications
You must be signed in to change notification settings - Fork 81
[GEN][ZH] Fix and simplify trailing LF in most logging related functions and macros #1229
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
Closed
xezon
wants to merge
17
commits into
TheSuperHackers:main
from
xezon:xezon/refactor-debuglog-newline
Closed
[GEN][ZH] Fix and simplify trailing LF in most logging related functions and macros #1229
xezon
wants to merge
17
commits into
TheSuperHackers:main
from
xezon:xezon/refactor-debuglog-newline
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…DEBUG_ASSERTCRASH, RELEASE_CRASH, RELEASE_CRASHLOCALIZED by script
…, WWRELEASE_ERROR, WWASSERT_PRINT, WWDEBUG_ERROR by script
…, WWRELEASE_ERROR, WWASSERT_PRINT, WWDEBUG_ERROR by script 2
…OUBLE_DEBUG, PERF_LOG, CRCGEN_LOG, STATECHANGED_LOG, PING_LOG, BONEPOS_LOG by script
…OUBLE_DEBUG, PERF_LOG, CRCGEN_LOG, STATECHANGED_LOG, PING_LOG, BONEPOS_LOG by script 2
This review is quite a bit heavy. I can try to chunk the commits better. |
I have reorganized the commits with new #1232. Closing this one. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change fixes and simplifies the trailing new line "\n" in most logging related functions and macros. The trailing \n is now appended in the logging wrapper itself, and so user code no longer needs to add it. This makes it less error prone.
The only disadvantage is that it gives no finer control over calling DEBUG_LOG multiple times to write to the same log line. However, that is a rare use case. If such a log is needed in the future, we can add a new DEBUG_LOG_RAW macro or so.
Affected macros are:
Some logging in WWVegas ended with \r\n (CR LF) which has been fixed as well.
Most log lines have been fixed with a script. Some lines have been fixed and polished by hand. I have labeled the commits accordingly.