File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 11#include " application.hpp"
22
3+ #include < string>
4+
35#include < QFile>
46#include < QOperatingSystemVersion>
57#include < QStyle>
1012
1113namespace Platform
1214{
15+ static void qtMessageHandler (QtMsgType type, const QMessageLogContext& context, const QString& msg)
16+ {
17+ Debug::Level level;
18+ switch (type)
19+ {
20+ case QtDebugMsg:
21+ level = Debug::Debug;
22+ break ;
23+ case QtInfoMsg:
24+ level = Debug::Info;
25+ break ;
26+ case QtWarningMsg:
27+ level = Debug::Warning;
28+ break ;
29+ case QtCriticalMsg:
30+ level = Debug::Error;
31+ break ;
32+ case QtFatalMsg:
33+ level = Debug::Error;
34+ break ;
35+ default :
36+ level = Debug::Debug;
37+ break ;
38+ }
39+
40+ Log (level) << qUtf8Printable (qFormatLogMessage (type, context, msg));
41+ }
42+
1343 Application::Application (int & argc, char * argv[])
1444 : QApplication(argc, argv)
1545 {
46+ qInstallMessageHandler (qtMessageHandler);
1647#if defined(WIN32) && QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
1748 init ();
1849 }
You can’t perform that action at this time.
0 commit comments