Questions Concerning colorizing text in Ubuntu terminal.
-
@Cougar-0 said in Questions Concerning colorizing text in Ubuntu terminal.:
I noticed it only colored update and not the word check.
The word
check
comes in yourmessageType
parameter, not in themessage
parameter which is where theupdate ...
string is. Hence is does not get colorized.You would either have to:
-
Subject the
messageType
parameter to the same escape sequence injection as you do on themessage
parameter. That is where factoring the colorizing code into its own function with a parameter would be a very good idea, as shown by @SGaist is his very first response. -
First create the whole string to be output (
QString fullMessage = QStringLiteral("[%1][%2]\t%3").arg(dateTimeStr, messageType, message)
) and then subject thatfullMessage
to the colorization code before outputting it instead of just themessage
.
But I said a long time ago I am not volunteering to write all the code... :)
-
-
I didn't expect you or anyone to write all the code for this, especially for nothing, that is why I offered to pay whoever could help me get this to work.
I don't have the 5 or 6 years left it would take me to learn how to do all this!
I will take it from here....
Thanks for everything!