summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Herrmann <fherrmann@de.adit-jv.com>2020-01-07 17:53:25 +0100
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2020-07-06 10:04:07 +0900
commit5e6cc588369c94697754db79cc00083976ab6f30 (patch)
treed354123b97c1d103a9602e3813db1dfccdc7fea6
parentf4325524cb5acdddbe26d32fab49aeed1d7f0b23 (diff)
downloadDLT-daemon-5e6cc588369c94697754db79cc00083976ab6f30.tar.gz
Limit log messages on full buffer
Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com>
-rw-r--r--src/daemon/dlt-daemon.c11
-rw-r--r--src/daemon/dlt_daemon_client.c4
2 files changed, 10 insertions, 5 deletions
diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c
index 54587dc..ee8b929 100644
--- a/src/daemon/dlt-daemon.c
+++ b/src/daemon/dlt-daemon.c
@@ -2849,10 +2849,15 @@ int dlt_daemon_process_user_message_log(DltDaemon *daemon,
}
ret = dlt_daemon_client_send_message_to_all_client(daemon,
- daemon_local, verbose);
+ daemon_local, verbose);
- if (DLT_DAEMON_ERROR_OK != ret)
- dlt_log(LOG_ERR, "failed to send message to client\n");
+ if (ret == DLT_DAEMON_ERROR_BUFFER_FULL && daemon->overflow_counter == 1) {
+ dlt_vlog(LOG_WARNING, "%s: buffer full, messages will be discarded.\n",
+ __func__);
+ } else if (ret != DLT_DAEMON_ERROR_OK &&
+ ret != DLT_DAEMON_ERROR_BUFFER_FULL) {
+ dlt_vlog(LOG_ERR, "%s: failed to send message to client\n", __func__);
+ }
/* keep not read data in buffer */
size = daemon_local->msg.headersize +
diff --git a/src/daemon/dlt_daemon_client.c b/src/daemon/dlt_daemon_client.c
index acd46f4..3d90a47 100644
--- a/src/daemon/dlt_daemon_client.c
+++ b/src/daemon/dlt_daemon_client.c
@@ -365,8 +365,8 @@ int dlt_daemon_client_send_message_to_all_client(DltDaemon *daemon,
if (daemon->overflow_counter) {
ret = dlt_daemon_send_message_overflow(daemon, daemon_local, verbose);
if (DLT_DAEMON_ERROR_OK == ret) {
- dlt_vlog(LOG_WARNING, "%u messages discarded!\n",
- daemon->overflow_counter);
+ dlt_vlog(LOG_WARNING, "%s: %u messages discarded! Now able to send messages to the client.\n",
+ __func__, daemon->overflow_counter);
daemon->overflow_counter = 0;
}
}