summaryrefslogtreecommitdiff
path: root/src/common/param_package.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/common/param_package.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/param_package.cpp b/src/common/param_package.cpp
index ab0154133..e0df430ab 100644
--- a/src/common/param_package.cpp
+++ b/src/common/param_package.cpp
@@ -25,7 +25,7 @@ ParamPackage::ParamPackage(const std::string& serialized) {
25 std::vector<std::string> key_value; 25 std::vector<std::string> key_value;
26 Common::SplitString(pair, KEY_VALUE_SEPARATOR, key_value); 26 Common::SplitString(pair, KEY_VALUE_SEPARATOR, key_value);
27 if (key_value.size() != 2) { 27 if (key_value.size() != 2) {
28 NGLOG_ERROR(Common, "invalid key pair {}", pair); 28 LOG_ERROR(Common, "invalid key pair {}", pair);
29 continue; 29 continue;
30 } 30 }
31 31
@@ -64,7 +64,7 @@ std::string ParamPackage::Serialize() const {
64std::string ParamPackage::Get(const std::string& key, const std::string& default_value) const { 64std::string ParamPackage::Get(const std::string& key, const std::string& default_value) const {
65 auto pair = data.find(key); 65 auto pair = data.find(key);
66 if (pair == data.end()) { 66 if (pair == data.end()) {
67 NGLOG_DEBUG(Common, "key '{}' not found", key); 67 LOG_DEBUG(Common, "key '{}' not found", key);
68 return default_value; 68 return default_value;
69 } 69 }
70 70
@@ -74,14 +74,14 @@ std::string ParamPackage::Get(const std::string& key, const std::string& default
74int ParamPackage::Get(const std::string& key, int default_value) const { 74int ParamPackage::Get(const std::string& key, int default_value) const {
75 auto pair = data.find(key); 75 auto pair = data.find(key);
76 if (pair == data.end()) { 76 if (pair == data.end()) {
77 NGLOG_DEBUG(Common, "key '{}' not found", key); 77 LOG_DEBUG(Common, "key '{}' not found", key);
78 return default_value; 78 return default_value;
79 } 79 }
80 80
81 try { 81 try {
82 return std::stoi(pair->second); 82 return std::stoi(pair->second);
83 } catch (const std::logic_error&) { 83 } catch (const std::logic_error&) {
84 NGLOG_ERROR(Common, "failed to convert {} to int", pair->second); 84 LOG_ERROR(Common, "failed to convert {} to int", pair->second);
85 return default_value; 85 return default_value;
86 } 86 }
87} 87}
@@ -89,14 +89,14 @@ int ParamPackage::Get(const std::string& key, int default_value) const {
89float ParamPackage::Get(const std::string& key, float default_value) const { 89float ParamPackage::Get(const std::string& key, float default_value) const {
90 auto pair = data.find(key); 90 auto pair = data.find(key);
91 if (pair == data.end()) { 91 if (pair == data.end()) {
92 NGLOG_DEBUG(Common, "key {} not found", key); 92 LOG_DEBUG(Common, "key {} not found", key);
93 return default_value; 93 return default_value;
94 } 94 }
95 95
96 try { 96 try {
97 return std::stof(pair->second); 97 return std::stof(pair->second);
98 } catch (const std::logic_error&) { 98 } catch (const std::logic_error&) {
99 NGLOG_ERROR(Common, "failed to convert {} to float", pair->second); 99 LOG_ERROR(Common, "failed to convert {} to float", pair->second);
100 return default_value; 100 return default_value;
101 } 101 }
102} 102}