diff options
author | Alexander Mohr <alexander.m.mohr@mercedes-benz.com> | 2022-10-05 10:32:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-05 10:32:15 +0200 |
commit | 5b80a4c92c9aa9ef45ce1da599b401ba631a86ed (patch) | |
tree | a8fa737aa20b222808a643516857cd9c5e2d23ac /include | |
parent | 34471d85fca14a5ec359d2d06a8d7018cb23beb2 (diff) | |
download | DLT-daemon-5b80a4c92c9aa9ef45ce1da599b401ba631a86ed.tar.gz |
internal-logging: Fix issues with file logging (#378)
This commit fixes the following issues if access
to the internal log file is not possible (logging_mode = DLT_LOG_TO_FILE)
* dlt_log_free tried to call fclose on a nullptr
Added a nullcheck for this
* Access to log file might be denied but access to logs is still wanted
Add a new CMake option WITH_DLT_FILE_LOGGING_SYSLOG_FALLBACK
If this is set to ON and the logging moe is set to file,
the dlt-daemon will fall back to syslog if opening the internal log
file failed
Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/dlt/dlt_common.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/dlt/dlt_common.h b/include/dlt/dlt_common.h index 9a99fce..100a481 100644 --- a/include/dlt/dlt_common.h +++ b/include/dlt/dlt_common.h @@ -1195,7 +1195,7 @@ void dlt_print_with_attributes(bool state); * Initialize (external) logging facility * @param mode positive, 0 = log to stdout, 1 = log to syslog, 2 = log to file, 3 = log to stderr */ -void dlt_log_init(int mode); +DltReturnValue dlt_log_init(int mode); /** * Print with variable arguments to specified file descriptor by DLT_LOG_MODE environment variable (like fprintf) * @param format format string for message |