Log prefix has to be updated per call after all
This commit is contained in:
parent
16f7356103
commit
67cf33b928
|
@ -35,7 +35,5 @@
|
||||||
#include "Logging.h"
|
#include "Logging.h"
|
||||||
|
|
||||||
// For thread_local, see : http://en.cppreference.com/w/cpp/language/storage_duration
|
// For thread_local, see : http://en.cppreference.com/w/cpp/language/storage_duration
|
||||||
thread_local const DWORD _CurrentThreadId = GetCurrentThreadId();
|
|
||||||
|
|
||||||
// TODO : Use Boost.Format http://www.boost.org/doc/libs/1_53_0/libs/format/index.html
|
// TODO : Use Boost.Format http://www.boost.org/doc/libs/1_53_0/libs/format/index.html
|
||||||
thread_local std::string _logPrefix;
|
thread_local std::string _logPrefix;
|
||||||
|
|
|
@ -139,8 +139,6 @@ inline const char * _log_sanitize(BOOLEAN value) { return value ? "TRUE" : "FALS
|
||||||
//
|
//
|
||||||
|
|
||||||
// For thread_local, see : http://en.cppreference.com/w/cpp/language/storage_duration
|
// For thread_local, see : http://en.cppreference.com/w/cpp/language/storage_duration
|
||||||
extern thread_local const DWORD _CurrentThreadId;
|
|
||||||
|
|
||||||
// TODO : Use Boost.Format http://www.boost.org/doc/libs/1_53_0/libs/format/index.html
|
// TODO : Use Boost.Format http://www.boost.org/doc/libs/1_53_0/libs/format/index.html
|
||||||
extern thread_local std::string _logPrefix;
|
extern thread_local std::string _logPrefix;
|
||||||
|
|
||||||
|
@ -148,11 +146,9 @@ extern thread_local std::string _logPrefix;
|
||||||
#define LOG_FUNC_BEGIN \
|
#define LOG_FUNC_BEGIN \
|
||||||
do { if(g_bPrintfOn) { \
|
do { if(g_bPrintfOn) { \
|
||||||
bool _had_arg = false; \
|
bool _had_arg = false; \
|
||||||
if (_logPrefix.empty()) { \
|
|
||||||
std::stringstream tmp; \
|
std::stringstream tmp; \
|
||||||
tmp << __FILENAME__ << " (" << hex2((uint16_t)_CurrentThreadId) << "): "; \
|
tmp << __FILENAME__ << " (" << hex2((uint16_t)GetCurrentThreadId()) << "): "; \
|
||||||
_logPrefix = tmp.str(); \
|
_logPrefix = tmp.str(); \
|
||||||
}; \
|
|
||||||
std::stringstream msg; \
|
std::stringstream msg; \
|
||||||
msg << _logPrefix << __func__ << "(";
|
msg << _logPrefix << __func__ << "(";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue