summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYusuke Sato <yusuke-sato@apn.alpine.co.jp>2018-05-18 14:32:01 +0900
committerChristoph Lipka <clipka@users.noreply.github.com>2018-05-18 07:32:01 +0200
commit89639e55c39687af398bdf9fbaf000338a5cb7db (patch)
tree0571e2a0f0ca8155f5fd55bfa78ce287ca40e442 /src
parent6e19bc70f05997413a33cee3d6b7c7e4f5834a20 (diff)
downloadDLT-daemon-89639e55c39687af398bdf9fbaf000338a5cb7db.tar.gz
dlt-daemon: Lower log level of logs not to output unintentional warning (#58)
* dlt-daemon: Lower log level of several logs not to output unintentional warning Change log level of several logs from WARNING to INFO. 1. User FIFO cannot be opened because the FIFO does not exist --> This case can happen if DLT user app is one-shot 2. Runtime configuration file (dlt-runtime-application.cfg / dlt-runtime-context.cfg) cannot be opened --> This case can happen in normal use case. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
Diffstat (limited to 'src')
-rw-r--r--src/daemon/dlt_daemon_common.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/daemon/dlt_daemon_common.c b/src/daemon/dlt_daemon_common.c
index 11be6e6..0f56cc3 100644
--- a/src/daemon/dlt_daemon_common.c
+++ b/src/daemon/dlt_daemon_common.c
@@ -401,8 +401,8 @@ DltDaemonApplication* dlt_daemon_application_add(DltDaemon *daemon, char *apid,
dlt_user_handle = open(filename, O_WRONLY|O_NONBLOCK);
if ( dlt_user_handle < 0 )
{
- snprintf(str,DLT_DAEMON_COMMON_TEXTBUFSIZE, "open() failed to %s, errno=%d (%s)!\n",filename,errno,strerror(errno)); /* errno 2: ENOENT - No such file or directory */
- dlt_log(LOG_WARNING, str);
+ int prio = (errno == ENOENT) ? LOG_INFO : LOG_WARNING;
+ dlt_vlog(prio, "open() failed to %s, errno=%d (%s)!\n", filename, errno, strerror(errno));
} /* if */
/* check if file file descriptor was already used, and make it invalid if it is reused */
@@ -507,8 +507,7 @@ int dlt_daemon_applications_load(DltDaemon *daemon, const char *filename, int ve
if (fd == NULL)
{
- snprintf(str,DLT_DAEMON_COMMON_TEXTBUFSIZE, "DLT runtime-application load, cannot open file %s: %s\n", filename, strerror(errno));
- dlt_log(LOG_WARNING, str);
+ dlt_vlog(LOG_INFO, "DLT runtime-application load, cannot open file %s: %s\n", filename, strerror(errno));
return -1;
}
@@ -883,8 +882,7 @@ int dlt_daemon_contexts_load(DltDaemon *daemon, const char *filename, int verbos
if (fd == NULL)
{
- snprintf(str,DLT_DAEMON_COMMON_TEXTBUFSIZE, "DLT runtime-context load, cannot open file %s: %s\n", filename, strerror(errno));
- dlt_log(LOG_WARNING, str);
+ dlt_vlog(LOG_INFO, "DLT runtime-context load, cannot open file %s: %s\n", filename, strerror(errno));
return -1;
}
@@ -1103,8 +1101,7 @@ int dlt_daemon_configuration_load(DltDaemon *daemon, const char *filename, int v
}
else
{
- snprintf(str,DLT_DAEMON_COMMON_TEXTBUFSIZE,"Cannot open configuration file: %s\n",filename);
- dlt_log(LOG_WARNING, str);
+ dlt_vlog(LOG_INFO, "Cannot open configuration file: %s\n",filename);
}
return 0;