Commit 91a69e8b51cfc9472dc8e4edd833118a8958d702

  • avatar
  • Sergey 'Jin' Bostandzhyan <jin @deve…per.digitalstrom.org>
  • Sun Aug 08 17:05:14 CEST 2010
Converted logger timestamp to local time
core/scripting/jslogger.cpp
(4 / 4)
  
2525#include "core/dss.h"
2626#include "core/logger.h"
2727#include "core/propertysystem.h"
28#include "core/datetools.h"
2829
2930#include <stdio.h>
3031#include <signal.h>
182182
183183 void ScriptLogger::log(const std::string& text) {
184184 if (m_f) {
185 struct tm t;
186 time_t now = time( NULL );
187 localtime_r( &now, &t );
188 std::string out = "[" + dateToISOString<std::string>(&t) + "] " + text;
185 DateTime timestamp = DateTime();
186
187 std::string out = "[" + timestamp.fromUTC().toString() + "] " + text;
189188 m_LogWriteMutex.lock();
190189 size_t written = fwrite(out.c_str(), 1, out.size(), m_f);
191190 fflush(m_f);