OSSP CVS Repository

ossp - Check-in [2316]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 2316
Date: 2002-Jul-18 17:18:30 (local)
2002-Jul-18 15:18:30 (UTC)
User:thl
Branch:
Comment: flush with lots of debugging stuff
Tickets:
Inspections:
Files:
ossp-pkg/fsl/fsl.c      1.12 -> 1.13     11 inserted, 1 deleted
ossp-pkg/fsl/fsl_test.c      1.1 -> 1.2     15 inserted, 0 deleted

ossp-pkg/fsl/fsl.c 1.12 -> 1.13

--- fsl.c        2002/07/18 14:07:33     1.12
+++ fsl.c        2002/07/18 15:18:30     1.13
@@ -499,6 +499,15 @@
     }
     if ((l2rv = l2_channel_open(ctx.l2_nch)) != L2_OK) {
         cp = l2_env_strerror(ctx.l2_env, l2rv); fprintf(stderr, "Error: logging failed to open channel stream %s(%d)\n", cp, l2rv); CU(1); }
+    if ((l2rv = l2_channel_log(ctx.l2_nch, L2_LEVEL_PANIC,    "testing L2_LEVEL_PANIC    0x%.8x", L2_LEVEL_PANIC   )) != L2_OK)               fprintf(stderr, "DEBUG: GOTCHA#0:%s(%d)\n", l2_env_strerror(ctx.l2_env, l2rv), l2rv);
+    if ((l2rv = l2_channel_log(ctx.l2_nch, L2_LEVEL_CRITICAL, "testing L2_LEVEL_CRITICAL 0x%.8x", L2_LEVEL_CRITICAL)) != L2_OK)               fprintf(stderr, "DEBUG: GOTCHA#1:%s(%d)\n", l2_env_strerror(ctx.l2_env, l2rv), l2rv);
+    if ((l2rv = l2_channel_log(ctx.l2_nch, L2_LEVEL_ERROR,    "testing L2_LEVEL_ERROR    0x%.8x", L2_LEVEL_ERROR   )) != L2_OK)               fprintf(stderr, "DEBUG: GOTCHA#2:%s(%d)\n", l2_env_strerror(ctx.l2_env, l2rv), l2rv);
+    if ((l2rv = l2_channel_log(ctx.l2_nch, L2_LEVEL_WARNING,  "testing L2_LEVEL_WARNING  0x%.8x", L2_LEVEL_WARNING )) != L2_OK)               fprintf(stderr, "DEBUG: GOTCHA#3:%s(%d)\n", l2_env_strerror(ctx.l2_env, l2rv), l2rv);
+    if ((l2rv = l2_channel_log(ctx.l2_nch, L2_LEVEL_NOTICE,   "testing L2_LEVEL_NOTICE   0x%.8x", L2_LEVEL_NOTICE  )) != L2_OK)               fprintf(stderr, "DEBUG: GOTCHA#4:%s(%d)\n", l2_env_strerror(ctx.l2_env, l2rv), l2rv);
+    if ((l2rv = l2_channel_log(ctx.l2_nch, L2_LEVEL_INFO,     "testing L2_LEVEL_INFO     0x%.8x", L2_LEVEL_INFO    )) != L2_OK)               fprintf(stderr, "DEBUG: GOTCHA#5:%s(%d)\n", l2_env_strerror(ctx.l2_env, l2rv), l2rv);
+    if ((l2rv = l2_channel_log(ctx.l2_nch, L2_LEVEL_TRACE,    "testing L2_LEVEL_TRACE    0x%.8x", L2_LEVEL_TRACE   )) != L2_OK)               fprintf(stderr, "DEBUG: GOTCHA#6:%s(%d)\n", l2_env_strerror(ctx.l2_env, l2rv), l2rv);
+    if ((l2rv = l2_channel_log(ctx.l2_nch, L2_LEVEL_DEBUG,    "testing L2_LEVEL_DEBUG    0x%.8x", L2_LEVEL_DEBUG   )) != L2_OK)               fprintf(stderr, "DEBUG: GOTCHA#7:%s(%d)\n", l2_env_strerror(ctx.l2_env, l2rv), l2rv);
+    if ((l2rv = l2_channel_log(ctx.l2_nch, L2_LEVEL_INFO|L2_LEVEL_CRITICAL, "combitest   0x%.8x", L2_LEVEL_INFO|L2_LEVEL_CRITICAL)) != L2_OK) fprintf(stderr, "DEBUG: GOTCHA#8:%s(%d)\n", l2_env_strerror(ctx.l2_env, l2rv), l2rv);
 
     ctx.maskpri = LOG_UPTO(LOG_DEBUG);
 
@@ -570,6 +579,7 @@
         return;
 
     priority &= LOG_PRIMASK; /* strip off facility */
+    fprintf(stderr, "DEBUG: prioriy=0x%.8lx\n", (unsigned long)priority);
 
     levelmask = 0;
     for (i = 0; sysloglevel2string[i].string != NULL; i++) {
@@ -577,7 +587,7 @@
         if (ctx.levelmap[i].syslog == priority)
             levelmask |= ctx.levelmap[i].l2;
     }
-    /*fprintf(stderr, "DEBUG: prioriy=0x%.8lx > levelmask=0x%.8lx\n", (unsigned long)priority, (unsigned long)levelmask);*/
+    fprintf(stderr, "DEBUG: levelmask=0x%.8lx\n", (unsigned long)levelmask);
     l2_channel_vlog(ctx.l2_nch, levelmask, fmt, args);
     return;
 }


ossp-pkg/fsl/fsl_test.c 1.1 -> 1.2

--- fsl_test.c   2002/07/09 09:42:09     1.1
+++ fsl_test.c   2002/07/18 15:18:30     1.2
@@ -9,6 +9,21 @@
     syslog(LOG_ALERT, "who: internal error 23\n");
     setlogmask(LOG_UPTO(LOG_ERR));
     syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m");
+    syslog(LOG_EMERG,   "syslogging LOG_EMERG   %d", LOG_EMERG  );
+    syslog(LOG_ALERT,   "syslogging LOG_ALERT   %d", LOG_ALERT  );
+    syslog(LOG_CRIT,    "syslogging LOG_CRIT    %d", LOG_CRIT   );
+    syslog(LOG_ERR,     "syslogging LOG_ERR     %d", LOG_ERR    );
+    syslog(LOG_WARNING, "syslogging LOG_WARNING %d", LOG_WARNING);
+    syslog(LOG_NOTICE,  "syslogging LOG_NOTICE  %d", LOG_NOTICE );
+    syslog(LOG_INFO,    "syslogging LOG_INFO    %d", LOG_INFO   );
+    syslog(LOG_DEBUG,   "syslogging LOG_DEBUG   %d", LOG_DEBUG  );
     return 0;
 }
 
+
+
+
+
+
+
+

CVSTrac 2.0.1