fix: remove the context line parameter

in release mode, this parameters are empty
This commit is contained in:
YiFang Xiao 2023-06-07 21:58:59 +08:00
parent f58eb43bd2
commit 47cc3ced1f

View file

@ -54,11 +54,8 @@ QMutex logMutex;
void gdMessageHandler( QtMsgType type, const QMessageLogContext &context, const QString &mess ) void gdMessageHandler( QtMsgType type, const QMessageLogContext &context, const QString &mess )
{ {
QString strTime = QDateTime::currentDateTime().toString( "MM-dd hh:mm:ss" ); QString strTime = QDateTime::currentDateTime().toString( "MM-dd hh:mm:ss" );
QString message = QString( "%1 file:%2,line:%3,function:%4 %5\r\n" ) QString message = QString( "%1 %2\r\n" )
.arg( strTime ) .arg( strTime )
.arg( context.file )
.arg( context.line )
.arg( context.function )
.arg( mess ); .arg( mess );
if ( ( logFilePtr != nullptr ) && logFilePtr->isOpen() ) { if ( ( logFilePtr != nullptr ) && logFilePtr->isOpen() ) {