[Git][NTPsec/ntpsec][master] Restore old log format given --enable-classic-mode.

Eric S. Raymond gitlab at mg.gitlab.com
Sun Aug 21 19:50:11 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
16aff058 by Eric S. Raymond at 2016-08-21T15:49:35-04:00
Restore old log format given --enable-classic-mode.

- - - - -


2 changed files:

- docs/index.txt
- libntp/humandate.c


Changes:

=====================================
docs/index.txt
=====================================
--- a/docs/index.txt
+++ b/docs/index.txt
@@ -177,6 +177,8 @@ few will be user-visible.
   has been removed.
 
 * Log timestamps look a little different; they are now in ISO8601 format.
+  The code can be built in a strict NTP Classic compatibility mode
+  that restores the old format.
 
 * Clock identifiers in log files are normally the driver shortname
   followed by the unit number in parentheses, rather than the magic IP


=====================================
libntp/humandate.c
=====================================
--- a/libntp/humandate.c
+++ b/libntp/humandate.c
@@ -26,11 +26,18 @@ humanlogtime(void)
 		return "-- --- --:--:--";
 
 	LIB_GETBUF(bp);
-	
+
+#ifdef ENABLE_CLASSIC_MODE
+	snprintf(bp, LIB_BUFLENGTH, "%2d %s %02d:%02d:%02d",
+		 tm->tm_mday, months[tm->tm_mon],
+		 tm->tm_hour, tm->tm_min, tm->tm_sec);
+#else
+	/* ISO8601 is a better format, sort order equals time order */
 	snprintf(bp, LIB_BUFLENGTH, "%02d-%02dT%02d:%02d:%02d",
 		 tm->tm_mon+1, tm->tm_mday,
 		 tm->tm_hour, tm->tm_min, tm->tm_sec);
-		
+#endif /* ENABLE_CLASSIC_MODE */
+
 	return bp;
 }
 



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/16aff05874c4dec3b2d69a46743875e797a5876c
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160821/59fdd425/attachment.html>


More information about the vc mailing list