diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2021-01-17 18:29:17 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2021-01-18 08:21:41 -0500 |
| commit | 181acfe832bef26228e33ac3a021d39528b1a4a9 (patch) | |
| tree | 8d72ee70536e85361c6ebaf95cb97eef87bef0ea /src/loglist.cpp | |
| parent | 1c4d09d9e13571cf7cd7f1ed502bc069d27ed399 (diff) | |
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
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();
|
