From patchwork Thu May 31 17:37:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: lib: fwts_log_html: remove timestamp as it is in the heading anyhow Date: Thu, 31 May 2012 07:37:49 -0000 From: Colin King X-Patchwork-Id: 162208 Message-Id: <1338485869-7565-1-git-send-email-colin.king@canonical.com> To: fwts-devel@lists.ubuntu.com From: Colin Ian King Signed-off-by: Colin Ian King Acked-by: Keng-Yu Lin Acked-by: Alex Hung Tested-by: Chris Van Hoof --- src/lib/src/fwts_log_html.c | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/src/lib/src/fwts_log_html.c b/src/lib/src/fwts_log_html.c index d293dbc..a70ac21 100644 --- a/src/lib/src/fwts_log_html.c +++ b/src/lib/src/fwts_log_html.c @@ -63,8 +63,6 @@ static int fwts_log_vprintf_html(fwts_log *log, const char *fmt, va_list args) { - struct tm tm; - time_t now; char *str; char *style; char *code_start; @@ -76,18 +74,8 @@ static int fwts_log_vprintf_html(fwts_log *log, if (field & (LOG_NEWLINE | LOG_SEPARATOR | LOG_DEBUG)) return 0; - time(&now); - localtime_r(&now, &tm); - fwts_log_html(log, "\n"); - if ((field & LOG_FIELD_MASK) != LOG_HEADING) { - fwts_log_html(log, " %2.2d/%2.2d/%-2.2d\n", - tm.tm_mday, tm.tm_mon + 1, (tm.tm_year+1900) % 100); - fwts_log_html(log, " %2.2d:%2.2d:%2.2d\n", - tm.tm_hour, tm.tm_min, tm.tm_sec); - } - if (field & LOG_VERBATUM) { code_start = "
";
 		code_end   = "
"; @@ -98,22 +86,22 @@ static int fwts_log_vprintf_html(fwts_log *log, switch (field & LOG_FIELD_MASK) { case LOG_ERROR: - fwts_log_html(log, " Error"); + fwts_log_html(log, " Error"); vfprintf(log->fp, fmt, args); fprintf(log->fp, "\n"); break; case LOG_WARNING: - fwts_log_html(log, " Warning%s", code_start); + fwts_log_html(log, " Warning%s", code_start); vfprintf(log->fp, fmt, args); fprintf(log->fp, "%s\n", code_end); break; case LOG_HEADING: - fwts_log_html(log, "%s", code_start); + fwts_log_html(log, "%s", code_start); vfprintf(log->fp, fmt, args); fprintf(log->fp, "%s\n", code_end); break; case LOG_INFO: - fwts_log_html(log, " %s", code_start); + fwts_log_html(log, " %s", code_start); vfprintf(log->fp, fmt, args); fprintf(log->fp, "%s\n", code_end); break; @@ -158,13 +146,13 @@ static int fwts_log_vprintf_html(fwts_log *log, break; case LOG_SUMMARY: - fwts_log_html(log, " %s", code_start); + fwts_log_html(log, " %s", code_start); vfprintf(log->fp, fmt, args); fprintf(log->fp, "%s\n", code_end); break; case LOG_ADVICE: - fwts_log_html(log, " Advice%s", code_start); + fwts_log_html(log, " Advice%s", code_start); vfprintf(log->fp, fmt, args); fprintf(log->fp, "%s\n", code_end); break; @@ -204,13 +192,13 @@ static void fwts_log_section_begin_html(fwts_log *log, const char *name) html_stack[html_stack_index].name = name; if (!strcmp(name, "summary")) { - fwts_log_html(log, "Summary\n"); + fwts_log_html(log, "Summary\n"); } else if (!strcmp(name, "heading")) { - fwts_log_html(log, "Firmware Test Suite\n"); + fwts_log_html(log, "Firmware Test Suite\n"); } else if (!strcmp(name, "subtest_info")) { - fwts_log_html(log, "\n"); + fwts_log_html(log, "\n"); } else if (!strcmp(name, "failure")) { - fwts_log_html(log, "\n"); + fwts_log_html(log, "\n"); } fflush(log->fp);