From 9cf8c10a22542ce784c383d7e371797c4b9910ac Mon Sep 17 00:00:00 2001 From: Saya Sugiura Date: Wed, 29 May 2019 17:58:37 +0900 Subject: cleanup: Use dlt_vlog() There were a couple of places which used snprintf-dlt_log. It is now replaced with dlt_vlog(). Signed-off-by: Saya Sugiura --- src/daemon/dlt_daemon_common.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'src/daemon/dlt_daemon_common.c') diff --git a/src/daemon/dlt_daemon_common.c b/src/daemon/dlt_daemon_common.c index 4a39d64..cb392dc 100644 --- a/src/daemon/dlt_daemon_common.c +++ b/src/daemon/dlt_daemon_common.c @@ -88,7 +88,6 @@ #include "dlt_daemon_socket.h" #include "dlt_daemon_serial.h" -static char str[DLT_DAEMON_COMMON_TEXTBUFSIZE]; char *app_recv_buffer = NULL; /* pointer to receiver buffer for application msges */ sem_t dlt_daemon_mutex; @@ -240,13 +239,8 @@ int dlt_daemon_init(DltDaemon *daemon, dlt_set_id(daemon->ecuid, ""); /* initialize ring buffer for client connection */ - snprintf(str, - DLT_DAEMON_COMMON_TEXTBUFSIZE, - "Ringbuffer configuration: %lu/%lu/%lu\n", - RingbufferMinSize, - RingbufferMaxSize, - RingbufferStepSize); - dlt_log(LOG_INFO, str); + dlt_vlog(LOG_INFO, "Ringbuffer configuration: %lu/%lu/%lu\n", + RingbufferMinSize, RingbufferMaxSize, RingbufferStepSize); if (dlt_buffer_init_dynamic(&(daemon->client_ringbuffer), RingbufferMinSize, RingbufferMaxSize, RingbufferStepSize) == DLT_RETURN_ERROR) @@ -1312,12 +1306,12 @@ int dlt_daemon_configuration_load(DltDaemon *daemon, const char *filename, int v /* parse arguments here */ if (strcmp(token, "LoggingMode") == 0) { daemon->mode = atoi(value); - snprintf(str, DLT_DAEMON_COMMON_TEXTBUFSIZE, "Runtime Option: %s=%d\n", token, daemon->mode); - dlt_log(LOG_INFO, str); + dlt_vlog(LOG_INFO, "Runtime Option: %s=%d\n", token, + daemon->mode); } else { - snprintf(str, DLT_DAEMON_COMMON_TEXTBUFSIZE, "Unknown option: %s=%s\n", token, value); - dlt_log(LOG_WARNING, str); + dlt_vlog(LOG_WARNING, "Unknown option: %s=%s\n", token, + value); } } } -- cgit v1.2.1