mirror of https://github.com/nirenjan/libx52.git
Merge commit 'dc72e43f1e43a0149c48a684d3b5fd40441ef83c'
commit
d9c1c80163
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue