Skip to content

Commit ad8e69b

Browse files
add logs
1 parent f853a97 commit ad8e69b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/ini_parser/ini_parser.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class ini_parser
9494
return std::stoi(sections.at(section).at(name));
9595
}catch(...)
9696
{
97-
printf("\x1b[1;31mget_int exeption section=%s name=%s\x1b[0m\n", section.data(), name.data());
97+
printf("\x1b[1;31mget_int exeption section=%s name=%s data=%s\x1b[0m\n", section.data(), name.data(), sections.at(section).at(name).data());
9898
return 0;
9999
}
100100
}
@@ -149,7 +149,7 @@ class ini_parser
149149
return std::stol(sections.at(section).at(name));
150150
}catch(...)
151151
{
152-
printf("\x1b[1;31mget_long exeption section=%s name=%s\x1b[0m\n", section.data(), name.data());
152+
printf("\x1b[1;31mget_long exeption section=%s name=%s data=%s\x1b[0m\n", section.data(), name.data(), sections.at(section).at(name).data());
153153
return 0;
154154
}
155155
}
@@ -166,7 +166,7 @@ class ini_parser
166166
return std::stof(sections.at(section).at(name));
167167
}catch(...)
168168
{
169-
printf("\x1b[1;31mget_float exeption section=%s name=%s\x1b[0m\n", section.data(), name.data());
169+
printf("\x1b[1;31mget_float exeption section=%s name=%s data=%s\x1b[0m\n", section.data(), name.data(), sections.at(section).at(name).data());
170170
return 0;
171171
}
172172
}
@@ -183,7 +183,7 @@ class ini_parser
183183
return std::stod(sections.at(section).at(name));
184184
}catch(...)
185185
{
186-
printf("\x1b[1;31mget_double exeption section=%s name=%s\x1b[0m\n", section.data(), name.data());
186+
printf("\x1b[1;31mget_double exeption section=%s name=%s data=%s\x1b[0m\n", section.data(), name.data(), sections.at(section).at(name).data());
187187
return 0;
188188
}
189189
}
@@ -309,6 +309,7 @@ class ini_parser
309309
handle_assignment(line);
310310
}
311311
}
312+
312313
return true;
313314
}
314315

@@ -336,6 +337,7 @@ class ini_parser
336337
std::string key = extract_key(line);
337338
std::string value = extract_value(line);
338339

340+
//printf("assignment:%s[%s]=%s\n", current_section.data(), key.data(), value.data());
339341
set_value(current_section, key, value);
340342
}
341343

0 commit comments

Comments
 (0)