diff options
author | LUONG HONG DUY KHANH(RBVH/ENG42) <KHANH.LUONGHONGDUY@vn.bosch.com> | 2020-03-18 13:40:43 +0700 |
---|---|---|
committer | Saya Sugiura <39760799+ssugiura@users.noreply.github.com> | 2020-07-06 10:04:07 +0900 |
commit | 156bb01a731661e0b90be90a58e56102352c33ad (patch) | |
tree | d87c1abe17dfff671477edf8f994b2f8b94e0f5d /include/dlt | |
parent | 573c1f9a0ba41b7ffa45f36e05b7f50aae3fb1ec (diff) | |
download | DLT-daemon-156bb01a731661e0b90be90a58e56102352c33ad.tar.gz |
Redirect stdout to stderr
- daemon: New feature for LoggingMode at /etc/dlt.conf to be able to
set value at 3 in order to redirect all stdout messages to stderr.
- libdlt: New feature for DLT_LOG_MODE environment variable to be able
to set value at 3 in order to redirect all stdout messages to stderr.
- unit test: Add test cases for DLT_LOG_TO_STDERR
Signed-off-by: LUONG HONG DUY KHANH(RBVH/ENG42) <KHANH.LUONGHONGDUY@vn.bosch.com>
Diffstat (limited to 'include/dlt')
-rw-r--r-- | include/dlt/dlt_common.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/dlt/dlt_common.h b/include/dlt/dlt_common.h index e5e4a22..026cf75 100644 --- a/include/dlt/dlt_common.h +++ b/include/dlt/dlt_common.h @@ -185,7 +185,8 @@ enum { DLT_LOG_TO_CONSOLE = 0, DLT_LOG_TO_SYSLOG = 1, DLT_LOG_TO_FILE = 2, - DLT_LOG_DROPPED = 3 + DLT_LOG_TO_STDERR = 3, + DLT_LOG_DROPPED = 4 }; /** @@ -1127,10 +1128,16 @@ void dlt_log_set_filename(const char *filename); void dlt_log_set_level(int level); /** * Initialize (external) logging facility - * @param mode positive, 0 = log to stdout, 1 = log to syslog, 2 = log to file + * @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); /** + * Print with variable arguments to specified file descriptor by DLT_LOG_MODE environment variable (like fprintf) + * @param format format string for message + * @return negative value if there was an error or the total number of characters written is returned on success + */ +int dlt_user_printf(const char *format, ...); +/** * Log ASCII string with null-termination to (external) logging facility * @param prio priority (see syslog() call) * @param s Pointer to ASCII string with null-termination |