aboutsummaryrefslogtreecommitdiff
path: root/src/main/input-output/input/json-parsing/json_helper.cpp
diff options
context:
space:
mode:
authorCharlie Blake2018-01-10 18:16:34 +0000
committerGitHub2018-01-10 18:16:34 +0000
commit2a62143fb9edb929f410b1b9b3aed16a16ceba39 (patch)
treed5d7839783cebb097af9f071751d693f47e3af6d /src/main/input-output/input/json-parsing/json_helper.cpp
parentMerge pull request #28 from thecharlesblake/all-canonical-games (diff)
parentAdd asserts to program and fix bugs they raise (diff)
downloadmetasol-2a62143fb9edb929f410b1b9b3aed16a16ceba39.tar.gz
metasol-2a62143fb9edb929f410b1b9b3aed16a16ceba39.zip

Merge pull request #29 from thecharlesblake/refactor-improve-debug

Refactor improve debug

Diffstat (limited to 'src/main/input-output/input/json-parsing/json_helper.cpp')
-rw-r--r--src/main/input-output/input/json-parsing/json_helper.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/input-output/input/json-parsing/json_helper.cpp b/src/main/input-output/input/json-parsing/json_helper.cpp
index 89f4564..f53da6c 100644
--- a/src/main/input-output/input/json-parsing/json_helper.cpp
+++ b/src/main/input-output/input/json-parsing/json_helper.cpp
@@ -6,6 +6,7 @@
#include <sstream>
#include "json_helper.h"
+#include "../../output/log_helper.h"
using namespace std;
using namespace rapidjson;
@@ -31,5 +32,11 @@ Document json_helper::get_file_json(const string& filename) {
}
void json_helper::json_parse_err(const string& msg) {
- throw runtime_error("Error in JSON doc: " + msg);
+ string err_msg = "Error in JSON doc: " + msg;
+ LOG_DEBUG(err_msg);
+ throw runtime_error(err_msg);
+}
+
+void json_helper::json_parse_warning(const string& msg) {
+ LOG_WARNING("Error in JSON doc: " + msg);
}