Browse Source

FIX:修复日志输出到txt中文乱码的bug

master
tianzhendong 11 months ago
parent
commit
789fc1a5d0
  1. 1
      loghandler.cpp

1
loghandler.cpp

@ -49,6 +49,7 @@ void messageHandler(QtMsgType type, const QMessageLogContext &context, const QSt
.arg(fileName).arg(context.line).arg(context.function).arg(msg);
std::cout << msgOut.toLocal8Bit().constData() << std::endl;
QTextStream in(&g_file);
in.setCodec("UTF-8");
in << msgOut << "\n";
// g_file.flush();
g_mutex.unlock();

Loading…
Cancel
Save