Commit 91a69e8b51cfc9472dc8e4edd833118a8958d702
- Diff rendering mode:
- inline
- side by side
core/scripting/jslogger.cpp
(4 / 4)
|   | |||
| 25 | 25 | #include "core/dss.h" | |
| 26 | 26 | #include "core/logger.h" | |
| 27 | 27 | #include "core/propertysystem.h" | |
| 28 | #include "core/datetools.h" | ||
| 28 | 29 | ||
| 29 | 30 | #include <stdio.h> | |
| 30 | 31 | #include <signal.h> | |
| … | … | ||
| 182 | 182 | ||
| 183 | 183 | void ScriptLogger::log(const std::string& text) { | |
| 184 | 184 | 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; | ||
| 189 | 188 | m_LogWriteMutex.lock(); | |
| 190 | 189 | size_t written = fwrite(out.c_str(), 1, out.size(), m_f); | |
| 191 | 190 | fflush(m_f); |

