diff options
Diffstat (limited to 'src/pacman/log.c')
-rw-r--r-- | src/pacman/log.c | 11 |
1 files changed, 10 insertions, 1 deletions
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 |