summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/LoggerI.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2002-07-31 16:01:26 +0000
committerMatthew Newhook <matthew@zeroc.com>2002-07-31 16:01:26 +0000
commitc1507126f37cd7046ebc60bf1239d92a7ce0c27b (patch)
tree0df37f986204f2422dc9953cf3404baeb3c89785 /cpp/src/Ice/LoggerI.cpp
parentImproved diagnostics for empty enumerations. (diff)
downloadice-c1507126f37cd7046ebc60bf1239d92a7ce0c27b.tar.bz2
ice-c1507126f37cd7046ebc60bf1239d92a7ce0c27b.tar.xz
ice-c1507126f37cd7046ebc60bf1239d92a7ce0c27b.zip
Logger is now globally mutex protected.
Diffstat (limited to 'cpp/src/Ice/LoggerI.cpp')
-rw-r--r--cpp/src/Ice/LoggerI.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/cpp/src/Ice/LoggerI.cpp b/cpp/src/Ice/LoggerI.cpp
index 720cd4d58a2..3fed27a131c 100644
--- a/cpp/src/Ice/LoggerI.cpp
+++ b/cpp/src/Ice/LoggerI.cpp
@@ -14,6 +14,8 @@ using namespace std;
using namespace Ice;
using namespace IceInternal;
+IceUtil::Mutex Ice::LoggerI::_globalMutex;
+
Ice::LoggerI::LoggerI(const string& prefix)
{
if(!prefix.empty())
@@ -30,7 +32,7 @@ Ice::LoggerI::LoggerI(const string& prefix)
void
Ice::LoggerI::trace(const string& category, const string& message)
{
- IceUtil::Mutex::Lock sync(*this);
+ IceUtil::Mutex::Lock sync(_globalMutex);
string s = "[ " + category + ": " + message + " ]";
string::size_type idx = 0;
while((idx = s.find("\n", idx)) != string::npos)
@@ -45,13 +47,13 @@ Ice::LoggerI::trace(const string& category, const string& message)
void
Ice::LoggerI::warning(const string& message)
{
- IceUtil::Mutex::Lock sync(*this);
+ IceUtil::Mutex::Lock sync(_globalMutex);
cerr << _prefix << "warning: " << message << endl;
}
void
Ice::LoggerI::error(const string& message)
{
- IceUtil::Mutex::Lock sync(*this);
+ IceUtil::Mutex::Lock sync(_globalMutex);
cerr << _prefix << "error: " << message << endl;
}