mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-31 20:09:35 -05:00
- implement log-time-ascii on windows.
git-svn-id: file:///svn/unbound/trunk@2684 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
c42a74b77c
commit
eb03758c79
2 changed files with 10 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
11 June 2012: Wouter
|
||||
- bug #452: fix crash on assert in mesh_state_attachment.
|
||||
- implement log-time-ascii on windows.
|
||||
|
||||
30 May 2012: Wouter
|
||||
- silence warning from swig-generated code (md set but not used in
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue