From 4adb13c9435baade511d3ac78fb142dc73bd2e1f Mon Sep 17 00:00:00 2001 From: Eran Mizrahi Date: Fri, 8 Dec 2017 18:24:06 +0200 Subject: generate dumps using new diagnostics settings --- src/usvfsconnector.cpp | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to 'src/usvfsconnector.cpp') diff --git a/src/usvfsconnector.cpp b/src/usvfsconnector.cpp index 0420ddc2..b90784d9 100644 --- a/src/usvfsconnector.cpp +++ b/src/usvfsconnector.cpp @@ -19,6 +19,8 @@ along with Mod Organizer. If not, see . #include "usvfsconnector.h" #include "settings.h" +#include "organizercore.h" +#include "shared/util.h" #include #include #include @@ -27,6 +29,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include static const char SHMID[] = "mod_organizer_instance"; @@ -101,14 +104,33 @@ LogLevel logLevel(int level) } } +CrashDumpsType crashDumpsType(int type) +{ + switch (type) { + case CrashDumpsType::Mini: + return CrashDumpsType::Mini; + case CrashDumpsType::Data: + return CrashDumpsType::Data; + case CrashDumpsType::Full: + return CrashDumpsType::Full; + default: + return CrashDumpsType::None; + } +} + UsvfsConnector::UsvfsConnector() { USVFSParameters params; LogLevel level = logLevel(Settings::instance().logLevel()); - USVFSInitParameters(¶ms, SHMID, false, level); + CrashDumpsType dumpType = crashDumpsType(Settings::instance().crashDumpsType()); + + std::string dumpPath = MOShared::ToString(OrganizerCore::crashDumpsPath(), true); + USVFSInitParameters(¶ms, SHMID, false, level, dumpType, dumpPath.c_str()); InitLogging(false); + + qDebug("Initializing VFS <%s, %d, %d, %s>", params.instanceName, params.logLevel, params.crashDumpsType, params.crashDumpsPath); + CreateVFS(¶ms); - SetLogLevel(level); BlacklistExecutable(L"TSVNCache.exe"); @@ -165,12 +187,6 @@ void UsvfsConnector::updateMapping(const MappingType &mapping) */ } -void UsvfsConnector::setLogLevel(int logLevel) { - switch (logLevel) { - case LogLevel::Debug: SetLogLevel(LogLevel::Debug); break; - case LogLevel::Info: SetLogLevel(LogLevel::Info); break; - case LogLevel::Warning: SetLogLevel(LogLevel::Warning); break; - case LogLevel::Error: SetLogLevel(LogLevel::Error); break; - default: SetLogLevel(LogLevel::Debug); break; - } +void UsvfsConnector::updateParams(int logLevel, int crashDumpsType) { + USVFSUpdateParams(::logLevel(logLevel), ::crashDumpsType(crashDumpsType)); } -- cgit v1.3.1 From 89b1f1d48dd05b372abca64b311b1107f044a897 Mon Sep 17 00:00:00 2001 From: Eran Mizrahi Date: Sat, 9 Dec 2017 01:26:50 +0200 Subject: add logging of process spawn --- src/organizercore.cpp | 4 ++++ src/usvfsconnector.cpp | 8 ++++++++ 2 files changed, 12 insertions(+) (limited to 'src/usvfsconnector.cpp') diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 7f86f2b4..54cfed54 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -1181,9 +1181,13 @@ HANDLE OrganizerCore::spawnBinaryDirect(const QFileInfo &binary, = QString("launch \"%1\" \"%2\" %3") .arg(QDir::toNativeSeparators(dataCwd), QDir::toNativeSeparators(dataBinPath), arguments); + + qDebug() << "Spawning proxyed process <" << cmdline << ">"; + return startBinary(QFileInfo(QCoreApplication::applicationFilePath()), cmdline, QCoreApplication::applicationDirPath(), true); } else { + qDebug() << "Spawning direct process <" << binary.absoluteFilePath() << "," << arguments << "," << currentDirectory.absolutePath() << ">"; return startBinary(binary, arguments, currentDirectory, true); } } else { diff --git a/src/usvfsconnector.cpp b/src/usvfsconnector.cpp index b90784d9..ffbdf3aa 100644 --- a/src/usvfsconnector.cpp +++ b/src/usvfsconnector.cpp @@ -158,6 +158,10 @@ void UsvfsConnector::updateMapping(const MappingType &mapping) progress.setMaximum(static_cast(mapping.size())); progress.show(); int value = 0; + int files = 0; + int dirs = 0; + + qDebug("Updating VFS mappings..."); ClearVirtualMappings(); @@ -173,11 +177,15 @@ void UsvfsConnector::updateMapping(const MappingType &mapping) (map.createTarget ? LINKFLAG_CREATETARGET : 0) | LINKFLAG_RECURSIVE ); + ++dirs; } else { VirtualLinkFile(map.source.toStdWString().c_str(), map.destination.toStdWString().c_str(), 0); + ++files; } } + + qDebug("VFS mappings updated ", dirs, files); /* size_t dumpSize = 0; CreateVFSDump(nullptr, &dumpSize); -- cgit v1.3.1