diff options
| author | Mikaƫl Capelle <capelle.mikael@gmail.com> | 2021-01-18 21:16:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-18 21:16:40 +0100 |
| commit | ee44a38c986d953a19cbb37b0297590844cf54ac (patch) | |
| tree | e39b12f7cb7f37cd96b3c3f451d2b527a81d4578 /src/loglist.cpp | |
| parent | 59f055ba93381b965cdc04557ac1dce2df36bd07 (diff) | |
| parent | 6feab2ea8f96704e44a14c212a635dc17f4ba71e (diff) | |
Merge pull request #1354 from isanae/startup-rework
Startup rework
Diffstat (limited to 'src/loglist.cpp')
| -rw-r--r-- | src/loglist.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/loglist.cpp b/src/loglist.cpp index 7f8f05bd..bea7363f 100644 --- a/src/loglist.cpp +++ b/src/loglist.cpp @@ -20,12 +20,18 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include "loglist.h"
#include "organizercore.h"
#include "copyeventfilter.h"
+#include "env.h"
using namespace MOBase;
static LogModel* g_instance = nullptr;
const std::size_t MaxLines = 1000;
+static std::unique_ptr<env::Console> m_console;
+static bool m_stdout = false;
+static std::mutex m_stdoutMutex;
+
+
LogModel::LogModel()
{
}
@@ -324,6 +330,21 @@ void qtLogCallback( }
}
+void logToStdout(bool b)
+{
+ m_stdout = b;
+
+ // logging to stdout is already set up in uibase by log::createDefault(),
+ // all it needs is to redirect stdout to the console, which is done by
+ // creating an env::Console object
+
+ if (m_stdout) {
+ m_console.reset(new env::Console);
+ } else {
+ m_console.reset();
+ }
+}
+
void initLogging()
{
LogModel::create();
|
