]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Clean up debug output
authorAlan T. DeKok <aland@freeradius.org>
Sun, 17 Mar 2013 04:44:21 +0000 (00:44 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 17 Mar 2013 04:44:21 +0000 (00:44 -0400)
src/main/conffile.c
src/main/modcall.c
src/main/modules.c

index c549df6cd810e3320691aadc896bc86639c2dce5..f78da46583a07fde1e440149587bc2195beac957 100644 (file)
@@ -2641,7 +2641,7 @@ void cf_log_module(const CONF_SECTION *cs, const char *fmt, ...)
        if (debug_flag > 1 && cf_log_modules && cs) {
                vsnprintf(buffer, sizeof(buffer), fmt, ap);
 
-               radlog(L_DBG, " Module: %s", buffer);
+               DEBUG("%.*s# %s", cs->depth, parse_spaces, buffer);
        }
        va_end(ap);
 }
index 6c9beffeb3d4a02a45df076eeb33550a4bb334a9..ff9d031590f99ba9b7680f6ed5489132307749d7 100644 (file)
@@ -2065,8 +2065,8 @@ static modcallable *do_compile_modsingle(modcallable *parent,
                }
 
                if (subcs) {
-                       DEBUG2(" Module: Loading virtual module %s",
-                              modrefname);
+                       cf_log_module(cs, "Loading virtual module %s",
+                                     modrefname);
 
                        /*
                         *      redundant foo {} is a single.
index 961690ccf42d632c350b887fd90abefb32b83873..4661bd98d7c8c204115dc9304b9deec2e6d9a655 100644 (file)
@@ -439,7 +439,7 @@ static module_entry_t *linkto_module(const char *module_name,
        node->module = module;
        node->handle = handle;
 
-       cf_log_module(cs, "Linked to module %s", module_name);
+       cf_log_module(cs, "Loaded module %s", module_name);
 
        /*
         *      Add the module as "rlm_foo-version" to the configuration
@@ -755,7 +755,7 @@ static int load_subcomponent_section(modcallable *parent, CONF_SECTION *cs,
        return 1;               /* OK */
 }
 
-static int define_type(const DICT_ATTR *dattr, const char *name)
+static int define_type(CONF_SECTION *cs, const DICT_ATTR *dattr, const char *name)
 {
        uint32_t value;
        DICT_VALUE *dval;
@@ -778,7 +778,7 @@ static int define_type(const DICT_ATTR *dattr, const char *name)
                value = fr_rand() & 0x00ffffff;
        } while (dict_valbyattr(dattr->attr, dattr->vendor, value));
 
-       DEBUG2("  Module: Creating %s = %s", dattr->name, name);
+       cf_log_module(cs, "Creating %s = %s", dattr->name, name);
        if (dict_addvalue(name, dattr->name, value) < 0) {
                radlog(L_ERR, "%s", fr_strerror());
                return 0;
@@ -942,8 +942,6 @@ static int load_byserver(CONF_SECTION *cs)
                            cf_section_filename(cs));
        }
 
-       cf_log_info(cs, " modules {");
-
        components = rbtree_create(indexed_modcallable_cmp, NULL, 0);
        if (!components) {
                radlog(L_ERR, "Failed to initialize components\n");
@@ -1006,7 +1004,7 @@ static int load_byserver(CONF_SECTION *cs)
                        if ((section_type_value[comp].attr == PW_AUTH_TYPE) &&
                            cf_item_is_pair(modref)) {
                                CONF_PAIR *cp = cf_itemtopair(modref);
-                               if (!define_type(dattr, cf_pair_attr(cp))) {
+                               if (!define_type(cs, dattr, cf_pair_attr(cp))) {
                                        goto error;
                                }
 
@@ -1019,8 +1017,8 @@ static int load_byserver(CONF_SECTION *cs)
                        name1 = cf_section_name1(subsubcs);
 
                        if (strcmp(name1, section_type_value[comp].typename) == 0) {
-                               if (!define_type(dattr,
-                                                cf_section_name2(subsubcs))) {
+                         if (!define_type(cs, dattr,
+                                          cf_section_name2(subsubcs))) {
                                        goto error;
                                }
                        }
@@ -1041,8 +1039,8 @@ static int load_byserver(CONF_SECTION *cs)
                        
                if (cf_item_find_next(subcs, NULL) == NULL) continue;
                        
-               cf_log_module(cs, "Checking %s {...} for more modules to load",
-                      section_type_value[comp].section);
+               cf_log_module(cs, "Loading %s {...}",
+                             section_type_value[comp].section);
 
                /*
                 *      Skip pre/post-proxy sections if we're not
@@ -1134,7 +1132,6 @@ static int load_byserver(CONF_SECTION *cs)
 #endif
        }
 
-       cf_log_info(cs, " } # modules");
        cf_log_info(cs, "} # server");
 
        if (!flag && name) {
@@ -1464,6 +1461,7 @@ int setup_modules(int reload, CONF_SECTION *config)
         *      because we've now split up the modules into
         *      mods-enabled.
         */
+       cf_log_info(cs, " modules {");
        for (ci=cf_item_find_next(modules, NULL);
             ci != NULL;
             ci=next) {
@@ -1482,6 +1480,7 @@ int setup_modules(int reload, CONF_SECTION *config)
                module = find_module_instance(modules, name, 1);
                if (!module) return -1;
        }
+       cf_log_info(cs, " } # modules");
 
        /*
         *      Loop over the listeners, figuring out which sections