[GEN][ZH] Fix and simplify trailing CR LF in most logging related functions and macros#1232
Conversation
ec50c38 to
9a94f0f
Compare
|
I'll review this, although I'm not yet sure about the best approach consider its size |
|
I mainly reviewed it by checking left-over \n and \r |
9a94f0f to
4ab3505
Compare
|
Rebased with Main. Fixed some mixups in 2 commits. |
|
you can try generating the preprocessed files and diffing them. Assuming everything here is done correctly, they should be identical |
Skyaero42
left a comment
There was a problem hiding this comment.
Some log entries contained double newline characters, which led to either a single lingering newline or completely blank log messages. Both cases are formatting artifacts and should be cleaned up to maintain log file consistency.
Hopefully I’ve tracked down all instances—fatigue was definitely setting in toward the end.
There was a problem hiding this comment.
I think EA placed this intentionally to make the log block stand out more.
GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngine/Source/GameLogic/Object/Update/StructureToppleUpdate.cpp
Outdated
Show resolved
Hide resolved
GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StructureToppleUpdate.cpp
Outdated
Show resolved
Hide resolved
4ab3505 to
485c085
Compare
|
Rebased on Main. I addressed all comments and some more. I appended changes with fixup commits, which will be squashed later. |
…with script (#1232)
…ED strings with script (#1232)
…ngs with script (#1232)
…EBUG, PERF_LOG, CRCGEN_LOG, STATECHANGED_LOG, PING_LOG, BONEPOS_LOG strings with script (#1232)
|
I have tested that individual commits build. |
…EBUG, PERF_LOG, CRCGEN_LOG, STATECHANGED_LOG, PING_LOG, BONEPOS_LOG strings with script (#1232)
…ED strings with script (TheSuperHackers#1232)
…EBUG, PERF_LOG, CRCGEN_LOG, STATECHANGED_LOG, PING_LOG, BONEPOS_LOG strings with script (TheSuperHackers#1232)
Merge with Rebase
This change fixes and simplifies the trailing Carriage Return \r and Line Feed \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:
REALLY_VERBOSE_LOGSome 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.