[ovs-dev] [PATCH V2] Using UTC in all of ovs logs
Arun Sharma
arun.sharma at calsoftinc.com
Fri Jun 29 19:50:15 UTC 2012
Fixed the remaining programs which does not logs in UTC timestamp format.
Also updated NEWS.
Signed-off-by: Arun Sharma <arun.sharma at calsoftinc.com>
---
NEWS | 5 ++++-
lib/table.c | 2 +-
lib/vlog.c | 4 ++--
ovsdb/ovsdb-tool.c | 2 +-
utilities/ovs-ofctl.c | 2 +-
5 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/NEWS b/NEWS
index f0b2490..f9f7d8c 100644
--- a/NEWS
+++ b/NEWS
@@ -20,7 +20,10 @@ post-v1.7.0
- Open vSwitch now sends RARP packets in situations where it previously
sent a custom protocol, making it consistent with behavior of QEMU and
VMware.
-
+ - Logging:
+ - "ovsdb-tool show-log" display records having UTC.
+ - "ovsdb-client --timestamp" display timestamp in UTC.
+ - "ovs-ofctl --timestamp" display timestamp in UTC.
v1.7.0 - xx xxx xxxx
------------------------
diff --git a/lib/table.c b/lib/table.c
index a8b35e2..f24ddc6 100644
--- a/lib/table.c
+++ b/lib/table.c
@@ -224,7 +224,7 @@ static void
table_format_timestamp__(char *s, size_t size)
{
time_t now = time_wall();
- strftime(s, size, "%Y-%m-%d %H:%M:%S", localtime(&now));
+ strftime(s, size, "%Y-%m-%d %H:%M:%S", gmtime(&now));
}
static void
diff --git a/lib/vlog.c b/lib/vlog.c
index e5c5feb..d26e613 100644
--- a/lib/vlog.c
+++ b/lib/vlog.c
@@ -498,8 +498,8 @@ vlog_init(void)
struct tm tm;
char s[128];
- localtime_r(&now, &tm);
- strftime(s, sizeof s, "%a, %d %b %Y %H:%M:%S %z", &tm);
+ gmtime_r(&now, &tm);
+ strftime(s, sizeof s, "%a, %d %b %Y %H:%M:%S", &tm);
VLOG_ERR("current time is negative: %s (%ld)", s, (long int) now);
}
diff --git a/ovsdb/ovsdb-tool.c b/ovsdb/ovsdb-tool.c
index f680989..f5412f3 100644
--- a/ovsdb/ovsdb-tool.c
+++ b/ovsdb/ovsdb-tool.c
@@ -513,7 +513,7 @@ do_show_log(int argc, char *argv[])
time_t t = json_integer(date);
char s[128];
- strftime(s, sizeof s, "%Y-%m-%d %H:%M:%S", localtime(&t));
+ strftime(s, sizeof s, "%Y-%m-%d %H:%M:%S", gmtime(&t));
printf(" %s", s);
}
diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index a2dfabf..dbc46cd 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -1127,7 +1127,7 @@ monitor_vconn(struct vconn *vconn)
time_t now = time_wall();
char s[32];
- strftime(s, sizeof s, "%Y-%m-%d %H:%M:%S: ", localtime(&now));
+ strftime(s, sizeof s, "%Y-%m-%d %H:%M:%S: ", gmtime(&now));
fputs(s, stderr);
}
--
1.7.2.5
More information about the dev
mailing list