File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -29,13 +29,10 @@ In you main file configure logger:
2929
3030int main (int argc, char* argv[ ] ) {
3131 std::string TAG = "MAIN";
32- std::string appLogPath = ".logs";
33- MyLogger * pLogger = new MyLogger();
3432
3533 // now you can use WsjcppYaml
3634 WsjcppYaml yaml;
37- yaml.setLogger(pLogger);
38- if (yaml.loadFromString(
35+ std::string sYaml =
3936 "# yaml content\n"
4037 "yaml1: nice format\n"
4138 "some-map: value1\n"
@@ -48,9 +45,10 @@ int main(int argc, char* argv[]) {
4845 " p2: v2 \n"
4946 " - p1: v3 \n"
5047 " p2: v4 \n"
51- "param2: 111\n"
52- )) {
53- yaml.throw_err(TAG, "Error parsing");
48+ "param2: 111\n";
49+ std::string sError;
50+ if (!yaml.loadFromString(sYaml, sError)) {
51+ yaml.throw_err(TAG, sError);
5452 return -1;
5553 }
5654
You can’t perform that action at this time.
0 commit comments