Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Find what you need - explore our website and developer resources
17 July 2024
Add some colors and some additional information so your QDebug() are more useful and easier to spot.
Non colorful but detailed setup:
export QT_MESSAGE_PATTERN='%{time} %{appname}(%{pid})/%{category} %{function}: %{message}'
My setup:
export QT_MESSAGE_PATTERN="`echo -e "\033[30m%{time hh:mm:ss.zzz} %{if-warning}\033[41mWARNING %{endif}\033[42m%{file}:%{line}\033[0m %{message}"`"
Links:
* Full discussion on qDebug from QWAM: https://youtu.be/f12lUvbdj2U?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI
* Ansi escape codes: https://en.wikipedia.org/wiki/ANSI_escape_code
* Original article from Woboq: https://woboq.com/blog/nice-debug-output-with-qt.html
All QML tips and tricks videos : https://www.youtube.com/playlist?list=PL6CJYn40gN6jWHP5krsQrVGyYtKh3A3be
All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Upgrade your applications from Qt 5 to Qt 6 with KDAB’s migration services. Get a free migration assessment and join a hands-on workshop to prepare your team for a successful transition!
Learn more