From e50a30ca356d1d0ac4398d672853cf74707a93d4 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 30 Oct 2023 17:15:26 +0000 Subject: [PATCH] [Minor] Use floating point ts instead of microseconds --- src/libserver/logger/logger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libserver/logger/logger.c b/src/libserver/logger/logger.c index 33117f72f..e10dfd392 100644 --- a/src/libserver/logger/logger.c +++ b/src/libserver/logger/logger.c @@ -1094,7 +1094,7 @@ void rspamd_log_fill_iov(struct rspamd_logger_iov_ctx *iov_ctx, /* Perform JSON logging */ guint slen = id ? strlen(id) : strlen("(NULL)"); slen = MIN(RSPAMD_LOG_ID_LEN, slen); - r = rspamd_snprintf(tmpbuf, sizeof(tmpbuf), "{\"ts\": %L, " + r = rspamd_snprintf(tmpbuf, sizeof(tmpbuf), "{\"ts\": %f, " "\"pid\": %P, " "\"severity\": \"%s\", " "\"worker_type\": \"%s\", " @@ -1102,7 +1102,7 @@ void rspamd_log_fill_iov(struct rspamd_logger_iov_ctx *iov_ctx, "\"module\": \"%s\", " "\"function\": \"%s\", " "\"message\": \"", - (gint64) (ts * 1e6), + ts, logger->pid, rspamd_get_log_severity_string(level_flags), logger->process_type, -- 2.39.5