Skip to content

Commit

Permalink
One more fix to main
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellGarwood committed Feb 7, 2020
1 parent 1352620 commit 8749321
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions SPIERSview/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ void logMessageOutput(QtMsgType type, const QMessageLogContext &context, const Q
txt = QString("Info: %1 (%2:%3, %4)").arg(localMsg.constData()).arg(context.file).arg(context.line).arg(context.function);
break;
}
}

#ifndef __APPLE__

Expand All @@ -55,21 +56,20 @@ void logMessageOutput(QtMsgType type, const QMessageLogContext &context, const Q
#endif

#ifdef QT_DEBUG
// Save to debug.log
QFile outFile("debug.log");
outFile.open(QIODevice::WriteOnly | QIODevice::Append);
QTextStream log(&outFile);
log << txt << endl;

// Now print to stout too
QTextStream console(stdout);
console << txt << endl;
// Save to debug.log
QFile outFile("debug.log");
outFile.open(QIODevice::WriteOnly | QIODevice::Append);
QTextStream log(&outFile);
log << txt << endl;

// Now print to stout too
QTextStream console(stdout);
console << txt << endl;
#else
// Print to stout only
QTextStream console(stdout);
console << txt << endl;
// Print to stout only
QTextStream console(stdout);
console << txt << endl;
#endif
}

/**
* @brief qMain::qMain
Expand Down

0 comments on commit 8749321

Please sign in to comment.