summaryrefslogtreecommitdiff
path: root/node/Logger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'node/Logger.cpp')
-rw-r--r--node/Logger.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/node/Logger.cpp b/node/Logger.cpp
index 7bed5990..71b4893d 100644
--- a/node/Logger.cpp
+++ b/node/Logger.cpp
@@ -30,6 +30,8 @@
#include <string.h>
#include <stdarg.h>
#include <time.h>
+
+#include "Constants.hpp"
#include "Logger.hpp"
namespace ZeroTier {
@@ -64,7 +66,12 @@ void Logger::log(const char *fmt,...)
if (_log) {
time_t now = time(0);
+#ifdef __WINDOWS__
+ ctime_s(tmp,sizeof(tmp),&now);
+ char *nowstr = tmp;
+#else
char *nowstr = ctime_r(&now,tmp);
+#endif
for(char *c=nowstr;*c;++c) {
if (*c == '\n')
*c = '\0';