DISPATCH-412: Support 'stdout' as log destination as well as 'stderr'
Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/fa6fafab Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/fa6fafab Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/fa6fafab Branch: refs/heads/master Commit: fa6fafabf4c1d6fe2a4ee2794932b9f4adbc1802 Parents: 34040b4 Author: Alan Conway <[email protected]> Authored: Tue Jun 28 10:10:32 2016 -0400 Committer: Alan Conway <[email protected]> Committed: Tue Jun 28 16:36:09 2016 -0400 ---------------------------------------------------------------------- src/log.c | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/fa6fafab/src/log.c ---------------------------------------------------------------------- diff --git a/src/log.c b/src/log.c index 4cd52c8..3e5aca6 100644 --- a/src/log.c +++ b/src/log.c @@ -79,6 +79,7 @@ DEQ_DECLARE(log_sink_t, log_sink_list_t); static log_sink_list_t sink_list = {0}; +static const char* SINK_STDOUT = "stdout"; static const char* SINK_STDERR = "stderr"; static const char* SINK_SYSLOG = "syslog"; static const char* SOURCE_DEFAULT = "DEFAULT"; @@ -118,6 +119,9 @@ static log_sink_t* log_sink_lh(const char* name) { if (strcmp(name, SINK_STDERR) == 0) { file = stderr; } + else if (strcmp(name, SINK_STDOUT) == 0) { + file = stdout; + } else if (strcmp(name, SINK_SYSLOG) == 0) { openlog(0, 0, LOG_DAEMON); syslog = true; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
