--- l2_test.c 2001/09/14 15:40:04 1.21
+++ l2_test.c 2001/09/14 18:49:36 1.22
@@ -68,8 +68,12 @@
l2_channel_t *chPrefix;
l2_channel_t *chBuf;
l2_channel_t *chFile;
+#ifdef WITH_SYSLOG
l2_channel_t *chSyslog;
+#endif
+#ifdef WITH_PIPE
l2_channel_t *chPipe;
+#endif
#ifdef WITH_SOCKET
l2_channel_t *chSock;
#endif
@@ -126,6 +130,7 @@
if (l2_channel_configure(chFile, "path,append,perm", "l2_test.log", TRUE, 0644) != L2_OK)
die("failed to configure file channel");
+#ifdef WITH_PIPE
if (pipe(pipdesc))
die("pipe() call failed");
@@ -134,6 +139,7 @@
if (l2_channel_configure(chPipe, "pipe", pipdesc[1]) != L2_OK)
die("failed to configure pipe channel");
+#endif
if (l2_channel_stack(chFile, chBuf) != L2_OK)
die("failed to stack buffer channel on top of file channel");
@@ -141,8 +147,10 @@
if (l2_channel_stack(chBuf, chPrefix) != L2_OK)
die("failed to stack prefix channel on top of buffer channel");
+#ifdef WITH_PIPE
if (l2_channel_stack(chPrefix, chPipe) != L2_OK)
die("failed to stack pipe channel on top of prefix channel");
+#endif
if (l2_channel_open(chPrefix) != L2_OK)
die("failed to open channel stack");
@@ -150,19 +158,20 @@
if (l2_stream_channel(st, chPrefix, L2_LEVEL_UPTO(L2_LEVEL_WARNING), L2_LEVEL_NONE) != L2_OK)
die("failed to attach channel stack into stream");
+#ifdef WITH_SYSLOG
if ((chSyslog = l2_channel_create(&l2_handler_syslog)) == NULL) /* Syslog */
die("failed to create syslog channel");
- if (l2_channel_configure(chSyslog, "ident,logopts,facility,priority,maskpriority",\
- "Test", (LOG_PID | LOG_CONS), LOG_USER, (LOG_CRIT|LOG_ALERT|LOG_NOTICE),\
- 0xFFFFFFFF) != L2_OK)
- die("failed to configure file channel");
+ if (l2_channel_configure(chSyslog, "ident,facility,target",
+ "L2-Test", "user", "local") != L2_OK)
+ die("failed to configure syslog channel");
if (l2_channel_open(chSyslog) != L2_OK)
die("failed to open channel stack");
if (l2_stream_channel(st, chSyslog, L2_LEVEL_UPTO(L2_LEVEL_WARNING), L2_LEVEL_NONE) != L2_OK)
die("failed to attach channel syslog into stream");
+#endif
#ifdef WITH_SMTP
if ((chSmtp = l2_channel_create(&l2_handler_smtp)) == NULL) /* SMTP */
|