From 7131b7ac87b9793c06d7b7e59df103658dd76ec7 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Fri, 20 Oct 2006 06:26:55 +0000 Subject: A handful of minor changes: * Removed the PMList typedef, in favor of the same naming scheme other structs use 'pmlist_t' * Added a time stamp on debug output, to make it more informational * Moved alpm_db_register to _alpm_db_register, making the public function not take a callback parameter --- src/pacman/log.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/pacman/log.c') diff --git a/src/pacman/log.c b/src/pacman/log.c index 25524fe3..52f30902 100644 --- a/src/pacman/log.c +++ b/src/pacman/log.c @@ -74,7 +74,16 @@ void cb_log(unsigned short level, char *msg) break; } - MSG(NL, "%s: %s\n", str, msg); + time_t t; + struct tm *tmp; + char timestr[10] = {0}; + + t = time(NULL); + tmp = localtime(&t); + strftime(timestr, 9, "%H:%M:%S", tmp); + timestr[8] = '\0'; + + MSG(NL, "[%s] %s: %s\n", timestr, str, msg); } /* Wrapper to fprintf() that allows to choose if we want the output -- cgit v1.2.3