aboutsummaryrefslogtreecommitdiffstats
path: root/CommonLibs/Logger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CommonLibs/Logger.cpp')
-rw-r--r--CommonLibs/Logger.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/CommonLibs/Logger.cpp b/CommonLibs/Logger.cpp
index b05e7fd..4c2a2d3 100644
--- a/CommonLibs/Logger.cpp
+++ b/CommonLibs/Logger.cpp
@@ -37,8 +37,6 @@
using namespace std;
-// Switches to enable/disable logging targets
-bool gLogToConsole = true;
Mutex gLogToLock;
// Global log level threshold:
@@ -101,18 +99,14 @@ Log::~Log()
if (mPriority <= LOG_ERR) {
cerr << mStream.str() << endl;
}
- // Log to file and console
- if (gLogToConsole) {
- int mlen = mStream.str().size();
- int neednl = (mlen==0 || mStream.str()[mlen-1] != '\n');
- ScopedLock lock(gLogToLock);
- if (gLogToConsole) {
- // The COUT() macro prevents messages from stomping each other but adds uninteresting thread numbers,
- // so just use std::cout.
- std::cout << mStream.str();
- if (neednl) std::cout<<"\n";
- }
- }
+
+ int mlen = mStream.str().size();
+ int neednl = (mlen==0 || mStream.str()[mlen-1] != '\n');
+ ScopedLock lock(gLogToLock);
+ // The COUT() macro prevents messages from stomping each other but adds uninteresting thread numbers,
+ // so just use std::cout.
+ std::cout << mStream.str();
+ if (neednl) std::cout<<"\n";
}
ostringstream& Log::get()