summaryrefslogtreecommitdiff
path: root/src/usvfsconnector.cpp
diff options
context:
space:
mode:
authorTannin <sherb@gmx.net>2016-06-19 15:59:50 +0200
committerTannin <sherb@gmx.net>2016-06-19 15:59:50 +0200
commit3d642563cbdb33784165e4f7d29dbaa66b455492 (patch)
tree2b52cb3bcfc6998cf76c8f4823df3782f1b886a0 /src/usvfsconnector.cpp
parent0100c86887764547a705db5c311bcb5d6939423d (diff)
usvfs log level can now be changed without a restart
Diffstat (limited to 'src/usvfsconnector.cpp')
-rw-r--r--src/usvfsconnector.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/usvfsconnector.cpp b/src/usvfsconnector.cpp
index d8818a9a..0fe3567c 100644
--- a/src/usvfsconnector.cpp
+++ b/src/usvfsconnector.cpp
@@ -22,6 +22,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <memory>
#include <sstream>
#include <iomanip>
+#include <usvfs.h>
#include <QTemporaryFile>
#include <QProgressDialog>
#include <QDateTime>
@@ -103,10 +104,11 @@ LogLevel logLevel(int level)
UsvfsConnector::UsvfsConnector()
{
USVFSParameters params;
- USVFSInitParameters(&params, SHMID, false,
- logLevel(Settings::instance().logLevel()));
+ LogLevel level = logLevel(Settings::instance().logLevel());
+ USVFSInitParameters(&params, SHMID, false, level);
InitLogging(false);
ConnectVFS(&params);
+ SetLogLevel(level);
BlacklistExecutable(L"TSVNCache.exe");
@@ -162,3 +164,13 @@ void UsvfsConnector::updateMapping(const MappingType &mapping)
qDebug(buffer.get());
*/
}
+
+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;
+ }
+}