Skip to content

Commit

Permalink
Fixes double timestamp by detection splitted messages
Browse files Browse the repository at this point in the history
  • Loading branch information
fortizc authored and asac committed Jun 11, 2024
1 parent 9845d42 commit 3cb27d0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion logserver/logserver_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ static int print_pvfmt_log(int fd, const struct logserver_log *log,

int logserver_utils_print_raw(int fd, const struct logserver_log *log)
{
// this is a continuation of the previous message
if (log->data.len == 2 && !strncmp(log->data.buf, "\r\n", 2))
return dprintf(fd, "%.*s", log->data.len, log->data.buf);

char *ts_fmt = pv_config_get_str(PV_LOG_FILETREE_TIMESTAMP_FORMAT);
if (!ts_fmt)
return dprintf(fd, "%.*s", log->data.len, log->data.buf);
Expand Down Expand Up @@ -220,4 +224,4 @@ char *logserver_utils_output_to_str(int out_type)
}

return "unknown";
}
}

0 comments on commit 3cb27d0

Please sign in to comment.