summaryrefslogtreecommitdiff
path: root/contrib/unbound/util/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/unbound/util/log.c')
-rw-r--r--contrib/unbound/util/log.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/unbound/util/log.c b/contrib/unbound/util/log.c
index fc07dc6a9cba..8c09c7ce3122 100644
--- a/contrib/unbound/util/log.c
+++ b/contrib/unbound/util/log.c
@@ -171,6 +171,8 @@ log_vmsg(int pri, const char* type,
#if defined(HAVE_STRFTIME) && defined(HAVE_LOCALTIME_R)
char tmbuf[32];
struct tm tm;
+#elif defined(UB_ON_WINDOWS)
+ char tmbuf[128], dtbuf[128];
#endif
(void)pri;
vsnprintf(message, sizeof(message), format, args);
@@ -218,6 +220,13 @@ log_vmsg(int pri, const char* type,
fprintf(logfile, "%s %s[%d:%x] %s: %s\n", tmbuf,
ident, (int)getpid(), tid?*tid:0, type, message);
} else
+#elif defined(UB_ON_WINDOWS)
+ if(log_time_asc && GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, NULL,
+ tmbuf, sizeof(tmbuf)) && GetDateFormat(LOCALE_USER_DEFAULT, 0,
+ NULL, NULL, dtbuf, sizeof(dtbuf))) {
+ fprintf(logfile, "%s %s %s[%d:%x] %s: %s\n", dtbuf, tmbuf,
+ ident, (int)getpid(), tid?*tid:0, type, message);
+ } else
#endif
fprintf(logfile, "[%u] %s[%d:%x] %s: %s\n", (unsigned)now,
ident, (int)getpid(), tid?*tid:0, type, message);