at work
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
#include <stdarg.h>
|
||||
#include <pthread.h>
|
||||
@@ -42,9 +43,9 @@ void static set_timestamp(char* buffer) {
|
||||
|
||||
clock_gettime(CLOCK_SOURCE, &tv);
|
||||
memset(buffer, '\0', MAX_TS_LEN);
|
||||
sprintf(buffer, "%04d-%02d-%02dT%02d:%02d:%02d.%ld+%s",
|
||||
sprintf(buffer, "%04d-%02d-%02dT%02d:%02d:%02d.%03ld+%s",
|
||||
ptm->tm_year + 1900, ptm->tm_mon + 1, ptm->tm_mday, ptm->tm_hour,
|
||||
ptm->tm_min, ptm->tm_sec, tv.tv_nsec, ptm->tm_zone);
|
||||
ptm->tm_min, ptm->tm_sec, tv.tv_nsec/(int64_t)1000000, ptm->tm_zone);
|
||||
}
|
||||
|
||||
void log_error(const char* format, ...) {
|
||||
|
||||
Reference in New Issue
Block a user