This is a ready-made code to facilitate logging Qt Applications outputs (with QDebug)
-
copy Logger folder in your code path
-
Add the
Logger.pri
file to the*.pro
file in your project
include($$PWD/Logger/Logger.pri)
- Add Logger Header in
main.cpp
(Application Entery Point)
#include "Logger.h"
- Add the configuration codes in the main file e.g
main.cpp
(Application Entery Point)
Logger::attach();
Logger::logging = true;
Note
You can see where the log is stored by printing Logger::logFileName