diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-24 20:58:18 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-24 20:58:18 +0300 |
commit | 75c5b3d32afdb34b824daafaa6d4300b9a8ec06b (patch) | |
tree | cd40cd214fd3f590ec7af6f4ca5c627d4ffed068 /src/logger.cpp | |
parent | 280e7f9dcf757bed0bf652cee1a1485c695cc757 (diff) | |
download | plus-75c5b3d32afdb34b824daafaa6d4300b9a8ec06b.tar.gz plus-75c5b3d32afdb34b824daafaa6d4300b9a8ec06b.tar.bz2 plus-75c5b3d32afdb34b824daafaa6d4300b9a8ec06b.tar.xz plus-75c5b3d32afdb34b824daafaa6d4300b9a8ec06b.zip |
Add option to disable logging for better performance while connected to server.
Diffstat (limited to 'src/logger.cpp')
-rw-r--r-- | src/logger.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/logger.cpp b/src/logger.cpp index 2b80602e8..5a3efb0ee 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -22,6 +22,8 @@ #include "logger.h" +#include "settings.h" + #include <iostream> #include <sstream> @@ -180,6 +182,9 @@ void Logger::dlog2(const std::string &str, void Logger::log1(const char *const buf) { + if (settings.disableLoggingInGame) + return; + // Get the current system time timeval tv; gettimeofday(&tv, nullptr); @@ -198,6 +203,9 @@ void Logger::log1(const char *const buf) void Logger::log(const char *const log_text, ...) { + if (settings.disableLoggingInGame) + return; + unsigned size = 1024; if (strlen(log_text) * 3 > size) size = static_cast<unsigned>(strlen(log_text) * 3); @@ -232,6 +240,9 @@ void Logger::log(const char *const log_text, ...) void Logger::log_r(const char *const log_text, ...) { + if (settings.disableLoggingInGame) + return; + SDL_mutexP(mMutex); unsigned size = 1024; |