1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

More precise timings for logs (microsecond resolution)

This commit is contained in:
Ivan Savenko 2014-09-23 16:01:43 +03:00
parent 33c0e24940
commit bfd3aab78d
2 changed files with 3 additions and 3 deletions

View File

@ -208,7 +208,7 @@ CLogFormatter::CLogFormatter() : CLogFormatter("%m") { }
CLogFormatter::CLogFormatter(const std::string & pattern) : pattern(pattern)
{
boost::posix_time::time_facet * facet = new boost::posix_time::time_facet("%H:%M:%S");
boost::posix_time::time_facet * facet = new boost::posix_time::time_facet("%H:%M:%S.%f");
dateStream.imbue(std::locale(dateStream.getloc(), facet));
}
@ -370,4 +370,4 @@ void CLogFileTarget::write(const LogRecord & record)
}
const CLogFormatter & CLogFileTarget::getFormatter() const { return formatter; }
void CLogFileTarget::setFormatter(const CLogFormatter & formatter) { this->formatter = formatter; }
void CLogFileTarget::setFormatter(const CLogFormatter & formatter) { this->formatter = formatter; }

View File

@ -188,7 +188,7 @@ private:
struct DLL_LINKAGE LogRecord
{
LogRecord(const CLoggerDomain & domain, ELogLevel::ELogLevel level, const std::string & message)
: domain(domain), level(level), message(message), timeStamp(boost::posix_time::second_clock::local_time()),
: domain(domain), level(level), message(message), timeStamp(boost::posix_time::microsec_clock::local_time()),
threadId(boost::this_thread::get_id()) { }
CLoggerDomain domain;