OSSP CVS Repository

ossp - Difference in ossp-pkg/l2/l2_test.c versions 1.43 and 1.44
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/l2/l2_test.c 1.43 -> 1.44

--- l2_test.c    2001/11/07 13:05:20     1.43
+++ l2_test.c    2001/11/07 16:17:09     1.44
@@ -60,12 +60,16 @@
 int main(int argc, char *argv[])
 {
     l2_channel_t *ch;
+#if 1
+    char *spec;
+#else
     l2_channel_t *chFilter;
     l2_channel_t *chPrefix;
     l2_channel_t *chBuffer;
     l2_channel_t *chFile;
     l2_channel_t *chSyslog;
     l2_channel_t *chSmtp;
+#endif
     l2_result_t rv;
     l2_env_t *env;
 
@@ -77,6 +81,19 @@
     if ((rv = l2_env_formatter(env, 'S', l2_util_fmt_dump, NULL)) != L2_OK)
         die(env, rv, "failed to configure formatter for %%S");
 
+#if 1
+    spec = "noop -> {"
+           "  prefix(prefix=\"[%d-%m-%Y/%H:%M:%S] %L test[%P]: \", timezone=\"local\")"
+           "  -> filter(regex=\"hecking\", negate=\"0\")"
+           "     -> buffer(size=\"800\")"
+           "        -> file(path=\"l2_test.log\",append=\"1\",perm=\"420\") ;"
+           "  syslog(ident=\"L2-Test\", facility=\"user\", "
+           "         remotehost=\"en1\", logpid=\"1\", target=\"remote\")"
+           "}";
+    fprintf(stderr, "configuring: %s\n", spec);
+    if ((rv = l2_spec(&ch, env, spec)) != L2_OK)
+        die(env, rv, "failed to parse specification");
+#else
     /* create noop channel */
     if ((rv = l2_channel_create(&ch, env, "noop")) != L2_OK)
         die(env, rv, "failed to create noop channel");
@@ -128,6 +145,7 @@
         die(env, rv, "failed to link file-related channels together as a child sequence");
     if ((rv = l2_channel_link(ch, L2_LINK_CHILD, chSyslog, NULL)) != L2_OK)
         die(env, rv, "failed to link syslog-related channels together as a child sequence");
+#endif
 
     /* open channel tree */
     if ((rv = l2_channel_open(ch)) != L2_OK)

CVSTrac 2.0.1