Qt qDebug()<< font color ?
Answered
Hey
How can I control what color my debug print is in clion? It seem that clion does some styling and I'm struggling to understand what and where.
I'd like to get different color prints from qDebug()/qFatal etc etc but all I get is red print in run window.
Please sign in to leave a comment.
Any1? @clionSupport ?
Hello! The qDebug macro uses the qt_message_print() function, which uses fprintf(stderr, ...). So CLion prints the output in accordance with File | Settings | Editor | Color Scheme | Console Colors > Console > Error output.
Amazing thanks! I was even able now to set the custom colors myself for all the different options!
Gotta say that was one "frustrating" thing to figure out by myself that I failed.... Perhaps some info/blog post somewhere to help others?
Regards
Dariusz
Thanks for the suggestion. I've created https://youtrack.jetbrains.com/issue/CPP-14656 based on it, feel free to comment or upvote in order to get updates.
Lovely thanks! - id mark the topic solved but I don't see the button :o
Also is there a reason why setting run.processes.with.pyt do disabled would cause qDebug to stop being displayed? I'm noticing weird behavior between my projects. One of them got qDebug working, others don't... strange stuff!
Regards
Dariusz
Probably, it's some line buffering issue which doesn't happened with PTY enabled since PTY is unbuffered by default. You can try using fflush(stdout) before qDebug or fflush(stderr) after qDebug, maybe some of these will help.