xmrig-nvidia
xmrig-nvidia copied to clipboard
Refactor and simplify color handling
Refactor and simplify color handling
- generate one version in color
- degrade to non-color at broadcast once, as required
- the ANSI sequences are too simple to keep double handling them, when they can be reliably filtered by a couple lines of code at the end instead
...instead of...
-
isColor ? X : Y
nearly everywhere, and -
X
andY
are basically the identical string- did not see any need for differences where there were actual differences it doesn't matter if there are some apostrophes around the colored action letter for example, plus then the content is identical aside from the color which just makes sense
Also refactored all the color defines, both so they stack and build from single definitions, and all primitives of ANSI attribute control used elsewhere in code are now there (\x1B[
everywhere was UUUUUUgly)
MUCH easier to change/add/check things, also can generate color even over in other sections (RED_BOLD on the self-test fail for example - it will get stripped if noncolor output destination, yay!)