File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -151,14 +151,20 @@ void Logger::write(const Logger::T_LOG_MESSAGE & message)
151151 name.resize (MAX_IDENTIFICATION_LENGTH, ' ' );
152152
153153 const QDateTime timestamp = QDateTime::fromMSecsSinceEpoch (message.utime );
154- std::cout << QString (" %1 %2 : <%3> %4%5" )
155- .arg (timestamp.toString (Qt::ISODateWithMs))
156- .arg (name)
157- .arg (LogLevelStrings[message.level ])
158- .arg (location)
159- .arg (message.message )
160- .toStdString ()
161- << std::endl;
154+ QString msg = timestamp.toString (Qt::ISODateWithMs)
155+ % " " % name
156+ % " : <" % LogLevelStrings[message.level ]
157+ % " > " % location
158+ % message.message % " \n " ;
159+
160+ #ifdef _WIN32
161+ if (IsDebuggerPresent ())
162+ {
163+ OutputDebugStringA (QSTRING_CSTR (msg));
164+ }
165+ else
166+ #endif
167+ std::cout << msg.toStdString ();
162168
163169 emit newLogMessage (message);
164170}
You can’t perform that action at this time.
0 commit comments