diff options
author | vng <viktor.govako@gmail.com> | 2012-05-16 22:41:43 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:38:33 +0300 |
commit | 4b31192e3bfa7fd5cc14a57cabde66ada5c30b34 (patch) | |
tree | 717282bedc2b7daa4e612cda6cf84cfa145e1d63 /base | |
parent | 2c109df2aaeb1305d289c9e18e683da5de755492 (diff) |
Some code fixes.
Diffstat (limited to 'base')
-rw-r--r-- | base/logging.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/base/logging.cpp b/base/logging.cpp index 8e9bddb6e8..6567f4f424 100644 --- a/base/logging.cpp +++ b/base/logging.cpp @@ -40,14 +40,15 @@ namespace my static int threadsCount = 1; static map<threads::ThreadID, int> m_shortThreadID; - threads::ThreadID id = threads::GetCurrentThreadID(); - if (m_shortThreadID[id] == 0) - m_shortThreadID[id] = threadsCount++; + + int & threadNumber = m_shortThreadID[threads::GetCurrentThreadID()]; + if (threadNumber == 0) + threadNumber = threadsCount++; ostringstream out; out << "LOG"; - out << " TID(" << m_shortThreadID[id] << ")"; + out << " TID(" << threadNumber << ")"; static Timer s_Timer; static char const * names[] = { "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL" }; |