OSSP CVS Repository

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

Check-in Number: 2415
Date: 2002-Jul-29 17:08:21 (local)
2002-Jul-29 15:08:21 (UTC)
User:thl
Branch:
Comment: improve readability and consistency of fsldebug logging
Tickets:
Inspections:
Files:
ossp-pkg/fsl/fsl.c      1.36 -> 1.37     11 inserted, 17 deleted

ossp-pkg/fsl/fsl.c 1.36 -> 1.37

--- fsl.c        2002/07/29 14:42:05     1.36
+++ fsl.c        2002/07/29 15:08:21     1.37
@@ -219,7 +219,7 @@
     if (filename == NULL || buffer == NULL)
         CU(FSL_ERR_ARG);
 
-    fsldebug(L2_LEVEL_TRACE, "appendfiletobuffer(buffer, filename=\"%s\")", filename);
+    fsldebug(L2_LEVEL_TRACE, "appendfiletobuffer() filename=\"%s\")", filename);
 
     if ((fd = open(filename, O_RDONLY)) == -1)
         CU(FSL_ERR_SYS);
@@ -264,7 +264,7 @@
 
     if (ident == NULL || buffer == NULL)
         CU(FSL_ERR_ARG);
-    fsldebug(L2_LEVEL_TRACE, "readfile(buffer, ident=\"%s\")", ident);
+    fsldebug(L2_LEVEL_TRACE, "readfile() ident=\"%s\")", ident);
 
     if ((filename = (char *)malloc(strlen(FSL_CFGDIR) + 1 + 
                                    strlen(FSL_PREFIX) + strlen(ident) + 1)) == NULL)
@@ -293,7 +293,7 @@
 
     if (buffer == NULL)
         CU(FSL_ERR_ARG);
-    fsldebug(L2_LEVEL_TRACE, "readallfiles(buffer) globbing \"%s/%s*\"", FSL_CFGDIR, FSL_PREFIX);
+    fsldebug(L2_LEVEL_TRACE, "readallfiles() globbing \"%s/%s*\"", FSL_CFGDIR, FSL_PREFIX);
 
     if ((dp = opendir(FSL_CFGDIR)) == NULL)
         CU(FSL_ERR_SYS);
@@ -331,13 +331,13 @@
 
     if (ident == NULL)
         return FSL_ERR_ARG;
-    fsldebug(L2_LEVEL_TRACE, "readfileorallfiles(buffer, ident=\"%s\")", ident);
+    fsldebug(L2_LEVEL_TRACE, "readfileorallfiles() ident=\"%s\")", ident);
 
     if ((rv = readfile(buffer, ident)) == FSL_OK)
         return FSL_OK;
     if (rv != FSL_ERR_SYS || errno != ENOENT)
         return rv;
-    fsldebug(L2_LEVEL_TRACE, "readfileorallfiles: file does not exist");
+    fsldebug(L2_LEVEL_TRACE, "readfileorallfiles: specific file does not exist, trying all files from directory");
     if ((rv = readallfiles(buffer)) != FSL_OK)
         return rv;
     return FSL_OK;
@@ -622,7 +622,7 @@
 
         /*  get right brother of current directive */
         if ((cfgrv = cfg_node_get(cfg, cfgdir, CFG_NODE_ATTR_RBROTH, &cfgdir)) != CFG_OK) {
-            (void)cfg_error(cfg, cfgrv, &cp); fsldebug(L2_LEVEL_ERROR, "cfg_node_get(CFG_NODE_ATTR_RBROTH) failed with error %s (%d)", cp, cfgrv); CU(FSL_ERR_CUS); }
+            (void)cfg_error(cfg, cfgrv, &cp); fsldebug(L2_LEVEL_ERROR, "processcfg: cfg_node_get(CFG_NODE_ATTR_RBROTH) failed with error %s (%d)", cp, cfgrv); CU(FSL_ERR_CUS); }
     }
 
     fsldebug(L2_LEVEL_TRACE, "processcfg: matched %d sections while looking for %s sections", matchcount, mode == 0 ? "ident" : "default");
@@ -687,8 +687,7 @@
     }
 
     /* tracing */
-    if (ctx.l2_fslnch != NULL)
-        fsldebug(L2_LEVEL_TRACE, "openlog(ident=\"%s\", logopt=0x%.8lx, facility=0x%.8lx)", ident, logopt, facility);
+    fsldebug(L2_LEVEL_TRACE, "openlog() ident=\"%s\", logopt=0x%.8lx, facility=0x%.8lx)", ident, logopt, facility);
 
     /* remember logopt and handle unsupported values */
     ctx.logopt = logopt;
@@ -795,8 +794,8 @@
 /* faked POSIX API function closelog(3) */
 void closelog(void)
 {
+    fsldebug(L2_LEVEL_TRACE, "closelog()");
     if (ctx.l2_fslnch != NULL) {
-        l2_channel_log(ctx.l2_fslnch, L2_LEVEL_TRACE, "closelog()");
         l2_channel_destroy(ctx.l2_fslnch);
         ctx.l2_fslnch = NULL;
     }
@@ -827,8 +826,7 @@
 {
     int oldmask;
 
-    if (ctx.l2_fslnch != NULL)
-        l2_channel_log(ctx.l2_fslnch, L2_LEVEL_TRACE, "setlogmask(maskpri=0x%.8lx)", maskpri);
+    fsldebug(L2_LEVEL_TRACE, "setlogmask() maskpri=0x%.8lx", maskpri);
     oldmask = ctx.maskpri;
     if (maskpri != 0)
         ctx.maskpri = maskpri;
@@ -863,12 +861,6 @@
     if (ctx.l2_nch == NULL)
         return;
 
-#if 0
-    /* tracing */
-    if (ctx.l2_fslnch != NULL)
-        l2_channel_log(ctx.l2_fslnch, L2_LEVEL_TRACE, "vsyslog(priority=%d, fmt=\"%s\", ...)", priority, fmt);
-#endif
-
     /* check for delayed open */
     if ((ctx.logopt & LOG_NDELAY) && (ctx.delayopen == TRUE)) {
         if ((l2rv = l2_channel_open(ctx.l2_nch)) != L2_OK) {
@@ -898,6 +890,8 @@
         }
     }
     fsldebug(L2_LEVEL_DEBUG, "vsyslog: levelmask=0x%.8lx", (unsigned long)levelmask);
+
+    /* the heart of FSL */
     if ((l2rv = l2_channel_vlog(ctx.l2_nch, levelmask, fmt, args)) != L2_OK) {
         cp = l2_env_strerror(ctx.l2_env, l2rv);
         fsldebug(L2_LEVEL_PANIC, "vsyslog: application logging failed: %s (%d)", cp, l2rv);

CVSTrac 2.0.1