More readable debug output
authoraland <aland>
Thu, 3 May 2007 08:29:27 +0000 (08:29 +0000)
committeraland <aland>
Thu, 3 May 2007 08:29:27 +0000 (08:29 +0000)
src/main/conffile.c
src/main/modules.c
src/modules/rlm_eap/eap.c

index d52f9ad..5d6ff1b 100644 (file)
@@ -890,6 +890,12 @@ int cf_section_parse(CONF_SECTION *cs, void *base,
        int i;
        void *data;
 
+       if (!cs->name2) {
+               DEBUG2(" %s {", cs->name1);
+       } else {
+               DEBUG2(" %s %s {", cs->name1, cs->name2);
+       }
+
        /*
         *      Handle the known configuration parameters.
         */
@@ -913,12 +919,14 @@ int cf_section_parse(CONF_SECTION *cs, void *base,
                        if (!variables[i].dflt) {
                                DEBUG2("Internal sanity check 1 failed in cf_section_parse");
                                cf_section_parse_free(base, variables);
+                               DEBUG2(" }");
                                return -1;
                        }
                        
                        if (cf_section_parse(subcs, base,
                                             (const CONF_PARSER *) variables[i].dflt) < 0) {
                                cf_section_parse_free(base, variables);
+                               DEBUG2(" }");
                                return -1;
                        }
                        continue;
@@ -931,6 +939,7 @@ int cf_section_parse(CONF_SECTION *cs, void *base,
                } else {
                        DEBUG2("Internal sanity check 2 failed in cf_section_parse");
                        cf_section_parse_free(base, variables);
+                       DEBUG2(" }");
                        return -1;
                }
 
@@ -940,10 +949,13 @@ int cf_section_parse(CONF_SECTION *cs, void *base,
                if (cf_item_parse(cs, variables[i].name, variables[i].type,
                                  data, variables[i].dflt) < 0) {
                        cf_section_parse_free(base, variables);
+                       DEBUG2(" }");
                        return -1;
                }
        } /* for all variables in the configuration section */
 
+       DEBUG2(" }");
+
        cs->base = base;
        cs->variables = variables;
 
index 41a71e4..f4cf917 100644 (file)
@@ -302,11 +302,6 @@ module_instance_t *find_module_instance(CONF_SECTION *modules,
        }
 
        DEBUG2("Module: Instantiating %s", instname);
-       if (name2) {
-               DEBUG(" %s %s {", name1, name2);
-       } else {
-               DEBUG(" %s {", name1);
-       }
 
        /*
         *      Call the module's instantiation routine.
@@ -349,8 +344,6 @@ module_instance_t *find_module_instance(CONF_SECTION *modules,
 #endif
        cf_data_add(cs, "instance", node, module_instance_free);
 
-       DEBUG2(" }");
-
        return node;
 }
 
index 3b1225f..06689f1 100644 (file)
@@ -120,6 +120,10 @@ int eaptype_load(EAP_TYPES **type, int eap_type, CONF_SECTION *cs)
                free(node);
                return -1;
        }
+       DEBUG("eap: Linked to sub-module %s", buffer);
+
+       DEBUG("eap: Instantiating eap-%s", eaptype_name);
+
        if ((node->type->attach) &&
            ((node->type->attach)(node->cs, &(node->type_data)) < 0)) {
 
@@ -130,7 +134,6 @@ int eaptype_load(EAP_TYPES **type, int eap_type, CONF_SECTION *cs)
                return -1;
        }
 
-       DEBUG("rlm_eap: Loaded and initialized type %s", eaptype_name);
        *type = node;
        return 0;
 }