From 3fc57ac61ff0d2b17b388f4fb63944064b2aaca9 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Wed, 6 Jun 2007 14:31:30 +0000 Subject: [PATCH] Display time in debug messages. --- lib/silcutil/silclog.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/silcutil/silclog.c b/lib/silcutil/silclog.c index 82eb5240..accb9126 100644 --- a/lib/silcutil/silclog.c +++ b/lib/silcutil/silclog.c @@ -4,7 +4,7 @@ Author: Pekka Riikonen - Copyright (C) 1997 - 2006 Pekka Riikonen + Copyright (C) 1997 - 2007 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -486,6 +486,8 @@ void silc_log_debug_hexdump(SilcBool enable) void silc_log_output_debug(char *file, const char *function, int line, char *string) { + SilcTimeStruct curtime; + #ifndef SILC_SYMBIAN if (!silclog.debug) goto end; @@ -501,6 +503,8 @@ void silc_log_output_debug(char *file, const char *function, } #endif /* !SILC_SYMBIAN */ + silc_time_value(0, &curtime); + #ifdef SILC_WIN32 if (strrchr(function, '\\')) fprintf(stderr, "%s:%d: %s\n", strrchr(function, '\\') + 1, line, string); @@ -509,10 +513,11 @@ void silc_log_output_debug(char *file, const char *function, #ifdef SILC_SYMBIAN silc_symbian_debug(function, line, string); #else - fprintf(stderr, "%s:%d: %s\n", function, line, string); + fprintf(stderr, "%02d:%02d.%d %s:%d: %s\n", curtime.minute, curtime.second, + curtime.msecond, function, line, string); fflush(stderr); #endif /* SILC_SYMBIAN */ - + end: silc_free(string); } -- 2.24.0