Use snptinrf ro the datetime logging, get rid of timezone (causes the

test to behave differently.
This commit is contained in:
Nils O. Selåsdal
2012-11-08 00:22:56 +01:00
parent ee44f30f11
commit 43abeaf2b9
2 changed files with 17 additions and 11 deletions
+9 -3
View File
@@ -306,11 +306,17 @@ static inline void uc_vlog_internal(const struct uc_log_args *args, const char *
if(dest->dest_type != UC_LDEST_SYSLOG && dest->type.file.file != NULL) {
char time_buf[48];
time_t now;
struct tm tmbuf;
struct tm t;
now = time(NULL);
localtime_r(&now, &tmbuf);
strftime(time_buf, sizeof time_buf, "%d %b %Y %H:%M:%S %Z", &tmbuf);
localtime_r(&now, &t);
snprintf(time_buf, sizeof time_buf, "%04d-%02d-%02d %02d:%02d:%02d",
t.tm_year + 1900,
t.tm_mon + 1,
t.tm_mday,
t.tm_hour,
t.tm_min,
t.tm_sec);
if(dest->log_location) {
fprintf(dest->type.file.file, "[%s] %s %s:%d [%s] : ", uc_ll_2_str(args->log_level),