Merge commit 'dc72e43f1e43a0149c48a684d3b5fd40441ef83c'

reverse-scroll
nirenjan 2021-08-03 11:26:06 -07:00
commit d9c1c80163
1 changed files with 6 additions and 3 deletions

View File

@ -180,12 +180,15 @@ void pinelog_log_message(int level, const char *file, int line, const char *fmt,
#if PINELOG_SHOW_DATE #if PINELOG_SHOW_DATE
do { do {
time_t t; time_t t;
struct tm tm1;
struct tm *tmp; struct tm *tmp;
char date_string[30]; char date_string[30];
t = time(NULL); t = time(NULL);
tmp = localtime(&t); tmp = localtime_r(&t, &tm1);
if (tmp != NULL) {
strftime(date_string, sizeof(date_string), "%F %T ", tmp); strftime(date_string, sizeof(date_string), "%F %T ", tmp);
fputs(date_string, output_stream); fputs(date_string, output_stream);
}
} while (0); } while (0);
#endif #endif