mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Show human-readable thread name in log
This commit is contained in:
@ -9,6 +9,7 @@
|
||||
*/
|
||||
#include "StdInc.h"
|
||||
#include "CLogger.h"
|
||||
#include "../CThreadHelper.h"
|
||||
|
||||
#ifdef VCMI_ANDROID
|
||||
#include <android/log.h>
|
||||
@ -427,8 +428,7 @@ void CLogConsoleTarget::setColorMapping(const CColorMapping & colorMapping) { th
|
||||
CLogFileTarget::CLogFileTarget(const boost::filesystem::path & filePath, bool append):
|
||||
file(filePath.c_str(), append ? std::ios_base::app : std::ios_base::out)
|
||||
{
|
||||
// formatter.setPattern("%d %l %n [%t] - %m");
|
||||
formatter.setPattern("%l %n [%t] - %m");
|
||||
formatter.setPattern("[%c] %l %n [%t] - %m");
|
||||
}
|
||||
|
||||
void CLogFileTarget::write(const LogRecord & record)
|
||||
@ -446,4 +446,14 @@ CLogFileTarget::~CLogFileTarget()
|
||||
file.close();
|
||||
}
|
||||
|
||||
LogRecord::LogRecord(const CLoggerDomain & domain, ELogLevel::ELogLevel level, const std::string & message)
|
||||
: domain(domain),
|
||||
level(level),
|
||||
message(message),
|
||||
timeStamp(boost::posix_time::microsec_clock::local_time()),
|
||||
threadId(getThreadName())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
|
Reference in New Issue
Block a user