+static void
+do_show_log(int argc UNUSED, char *argv[])
+{
+ const char *db_file_name = argv[1];
+ struct ovsdb_log *log;
+ unsigned int i;
+
+ check_ovsdb_error(ovsdb_log_open(db_file_name, O_RDONLY, &log));
+ for (i = 0; ; i++) {
+ struct json *json;
+
+ check_ovsdb_error(ovsdb_log_read(log, &json));
+ if (!json) {
+ break;
+ }
+
+ printf("record %u:", i);
+ if (json->type == JSON_OBJECT) {
+ struct json *date, *comment;
+
+ date = shash_find_data(json_object(json), "_date");
+ if (date && date->type == JSON_INTEGER) {
+ time_t t = json_integer(date);
+ char s[128];
+
+ strftime(s, sizeof s, "%Y-%m-%d %H:%M:%S", localtime(&t));
+ printf(" %s", s);
+ }
+
+ comment = shash_find_data(json_object(json), "_comment");
+ if (comment && comment->type == JSON_STRING) {
+ printf(" \"%s\"", json_string(comment));
+ }
+ }
+ json_destroy(json);
+ putchar('\n');
+ }
+}
+