Skip to content

Commit 818d3fa

Browse files
committed
Extend config parsing debug log
1 parent 31759d8 commit 818d3fa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/config/Config.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ void Config::removeComments() {
153153

154154
Context &Config::parseContext(Context &context, std::string data, size_t line,
155155
bool validateResult) {
156-
accessLog_g.write("Context: '" + context.getName() + "' -> Parsing", DEBUG);
156+
accessLog_g.write(_path + ":" + toString(line) + " Context: '" + context.getName() + "' -> Parsing", DEBUG);
157157
size_t startLine = line;
158158
while (true) {
159159
// Trim leading whitespace
@@ -192,7 +192,7 @@ Context &Config::parseContext(Context &context, std::string data, size_t line,
192192
} else if (isValidContext(context, token)) {
193193
processContext(context, data, token, line);
194194
} else
195-
checkError(line, "Invalid token '" + token + "'");
195+
throwExeption(line, "Invalid token '" + token + "'");
196196
}
197197
// Validate parsed context
198198
if (validateResult) checkError(startLine, validate(context, false));
@@ -242,8 +242,8 @@ void Config::processInclude(Context &context, std::string path) {
242242
std::set<std::string> files = processWildcardPath(includePath);
243243
std::set<std::string>::iterator itr = files.begin();
244244
for (; itr != files.end(); itr++) {
245-
accessLog_g.write(
246-
"Context: '" + context.getName() + "' -> Include '" + *itr + "'",
245+
accessLog_g.write( _path +
246+
" Context: '" + context.getName() + "' -> Include '" + *itr + "'",
247247
DEBUG);
248248
// Recursively parse included config files
249249
Config config(*itr, _includePath);
@@ -299,7 +299,7 @@ std::string Config::validArguments(Context &context, std::string token,
299299
}
300300

301301
std::string Config::validate(Context &context, bool recursive) {
302-
accessLog_g.write("Context: '" + context.getName() + "' -> Validating",
302+
accessLog_g.write(_path + " Context: '" + context.getName() + "' -> Validating",
303303
DEBUG);
304304
for (size_t i = 0; i < sizeof(tokens_g) / sizeof(token_t); i++) {
305305
if (tokens_g[i].parent == context.getName() &&

0 commit comments

Comments
 (0)