settings: Reduce log verbosity if files can't be opened
authorTobias Brunner <tobias@strongswan.org>
Tue, 29 Apr 2014 09:39:57 +0000 (11:39 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 15 May 2014 09:28:09 +0000 (11:28 +0200)
Basically reintroducing 2a38b4556e9fd8102bd6c6c61f2893599a5e8e51.

src/libstrongswan/settings/settings_parser.y
src/libstrongswan/utils/parser_helper.c

index b81003f..d5566df 100644 (file)
@@ -255,7 +255,16 @@ bool settings_parser_parse_file(section_t *root, char *name)
        helper->file_include(helper, name);
        if (!settings_parser_open_next_file(helper))
        {
-               DBG1(DBG_CFG, "failed to open config file '%s'", name);
+#ifdef STRONGSWAN_CONF
+               if (streq(name, STRONGSWAN_CONF))
+               {
+                       DBG2(DBG_CFG, "failed to open config file '%s'", name);
+               }
+               else
+#endif
+               {
+                       DBG1(DBG_CFG, "failed to open config file '%s'", name);
+               }
        }
        else
        {
index fb549a5..5093166 100644 (file)
@@ -111,7 +111,7 @@ METHOD(parser_helper_t, file_next, parser_helper_file_t*,
                                array_insert(this->files, ARRAY_TAIL, next);
                                return &next->public;
                        }
-                       PARSER_DBG1(&this->public, "unable to open '%s'", name);
+                       PARSER_DBG2(&this->public, "unable to open '%s'", name);
                        parser_helper_file_destroy(next);
                }
                file->matches->destroy(file->matches);