- Log timestamp format is ISO8601 now
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Sun, 8 Mar 2015 15:55:07 +0000 (15:55 +0000)
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Sun, 8 Mar 2015 15:55:07 +0000 (15:55 +0000)
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/branches/1.0.x@5660 82007160-df01-0410-b94d-b575c5fd34c7

NEWS
src/log.c
src/scan.c

diff --git a/NEWS b/NEWS
index 24c75c6f3d0dd84f5a33c3f867d5a1f77bc2a294..bec93435895dde16d32f00b2f0764a304812164c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+-- Noteworthy changes in version 1.0.4 (2015-??-??)
+o) Log timestamp format is ISO8601 now
+
+
 -- Noteworthy changes in version 1.0.3 (2015-01-28)
 o) Fixed bug where HOPM wouldn't try re-connecting to the server in
    case the connection got lost.
index c5fa1d720dd715b3c7e3ff4030b8b9f0020413ac..c7c708a6c628ab7b82ebba812bcb2b9d4a7a6e85 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -76,15 +76,13 @@ log_printf(const char *data, ...)
   char data2[513];
   char buf_present[25];
   va_list arglist;
-  time_t present;
-  struct tm *tm_present;
+  time_t present = 0;
 
   if (OPT_DEBUG == 0 && logfile == NULL)
     return;
 
   time(&present);
-  tm_present = gmtime(&present);
-  strftime(buf_present, sizeof(buf_present), "%b %d %H:%M:%S %Y", tm_present);
+  strftime(buf_present, sizeof(buf_present), "%FT%H:%M:%S%z", localtime(&present));
 
   va_start(arglist, data);
   vsnprintf(data2, 512, data, arglist);
index b9a7273a18ec4cb0d42b0cee8bca2478944eb6ee..ca8492ed1a550bfd613e1f25a0bc3fd3b1ed542c 100644 (file)
@@ -1013,17 +1013,15 @@ scan_checkexempt(const char *mask, const char *ipmask)
 static void
 scan_log(OPM_REMOTE_T *remote)
 {
-  char buf_present[25];
-  time_t present;
-  struct tm *tm_present;
+  char buf_present[32];
+  time_t present = 0;
   struct scan_struct *ss = remote->data;
 
   if (!(OptionsItem->scanlog && scanlogfile))
     return;
 
   time(&present);
-  tm_present = gmtime(&present);
-  strftime(buf_present, sizeof(buf_present), "%b %d %H:%M:%S %Y", tm_present);
+  strftime(buf_present, sizeof(buf_present), "%FT%H:%M:%S%z", localtime(&present));
 
   fprintf(scanlogfile, "[%s] %s:%d (%s) \"%s\"\n", buf_present, remote->ip,
           remote->port, scan_gettype(remote->protocol), ss->proof);