Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/platform/qt/scripting/ScriptingController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "input/GamepadButtonEvent.h"
#include "input/GamepadHatEvent.h"
#include "InputController.h"
#include "LogController.h"
#include "scripting/AutorunScriptView.h"
#include "scripting/ScriptingTextBuffer.h"
#include "scripting/ScriptingTextBufferModel.h"
Expand All @@ -39,6 +40,11 @@ ScriptingController::ScriptingController(ConfigController* config, QObject* pare
va_copy(argc, args);
QString message = QString::vasprintf(format, argc);
va_end(argc);
if (logger->p->m_config->getOption("logToStdout").toInt()) {
QTextStream out(stdout);
out << message << "\n";
out.flush();
Comment on lines +45 to +46
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LogController.cpp uses a QT_VERSION check to make sure that endl is defined, but this equivalent implementation works in all Qt versions. Maybe we could apply the same change there to remove a conditional compilation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the very least, IMO the #define endl Qt::endl should be replaced with using Qt::endl;.

}
switch (level) {
case mLOG_WARN:
emit logger->p->warn(message);
Expand Down