From: wessels <> Date: Sat, 21 Feb 1998 01:47:49 +0000 (+0000) Subject: make accessLogTime public so it can be used by debug.c X-Git-Tag: SQUID_3_0_PRE1~4051 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c6e7cab0ce582a02f9fa0cdeb8c1cdb942921d0d;p=thirdparty%2Fsquid.git make accessLogTime public so it can be used by debug.c --- diff --git a/src/access_log.cc b/src/access_log.cc index d54c85bb99..5628fdf8e2 100644 --- a/src/access_log.cc +++ b/src/access_log.cc @@ -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; +} diff --git a/src/protos.h b/src/protos.h index 5b54a101a5..d9a58c2009 100644 --- a/src/protos.h +++ b/src/protos.h @@ -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 *,