From 181acfe832bef26228e33ac3a021d39528b1a4a9 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Sun, 17 Jan 2021 18:29:17 -0500 Subject: renamed Refresh to TriggerRefresh, added WaitForRefresh removed duplicate refreshDirectoryStructure() call that could never work added --logs to output logs to stdout, added final "mod organizer done" log added -i with no arguments to output the current instance name `run -e` now does an additional, case insensitive check for names fixed error being output along with --help --- src/loglist.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/loglist.cpp') 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 . #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 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(); -- cgit v1.3.1