]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
make accessLogTime public so it can be used by debug.c
authorwessels <>
Sat, 21 Feb 1998 01:47:49 +0000 (01:47 +0000)
committerwessels <>
Sat, 21 Feb 1998 01:47:49 +0000 (01:47 +0000)
src/access_log.cc
src/protos.h

index d54c85bb9984a98e4ded79cf8f3c6b7d5b06e06d..5628fdf8e22f594a754d1f7f0e433c93ee65d38e 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: access_log.cc,v 1.21 1998/02/03 22:08:10 wessels Exp $
+ * $Id: access_log.cc,v 1.22 1998/02/20 18:47:49 wessels Exp $
  *
  * DEBUG: section 46    Access Log
  * AUTHOR: Duane Wessels
@@ -317,3 +317,17 @@ accessLogInit(void)
     assert(sizeof(log_tags) == (LOG_TYPE_MAX + 1) * sizeof(char *));
     accessLogOpen(Config.Log.access);
 }
+
+const char *
+accessLogTime(time_t t)
+{
+    struct tm *tm;
+    static char buf[128];
+    static time_t last_t = 0;
+    if (t != last_t) {
+       tm = localtime(&t);
+       strftime(buf, 127, "%Y/%m/%d %H:%M:%S", tm);
+       last_t = t;
+    }
+    return buf;
+}
index 5b54a101a53c087f563708d341b121843f0dd511..d9a58c20094a0c528debb4661363fca8693b389d 100644 (file)
@@ -4,6 +4,7 @@ extern void accessLogLog(AccessLogEntry *);
 extern void accessLogRotate(void);
 extern void accessLogClose(void);
 extern void accessLogInit(void);
+extern const char *accessLogTime(time_t);
 extern void hierarchyNote(HierarchyLogEntry *, hier_code, icp_ping_data *, const char *);
 
 extern aclCheck_t *aclChecklistCreate(const struct _acl_access *,