mirror of
https://github.com/akuker/RASCSI.git
synced 2024-09-29 13:54:48 +00:00
Ignore unknown parameters and log a warning (#730)
* Ignore unknown parameters and log a warning * Added comment * Updated logging
This commit is contained in:
parent
9099d7249c
commit
f32c20883e
@ -126,8 +126,14 @@ void Device::SetParams(const unordered_map<string, string>& params)
|
|||||||
this->params = GetDefaultParams();
|
this->params = GetDefaultParams();
|
||||||
|
|
||||||
for (const auto& param : params) {
|
for (const auto& param : params) {
|
||||||
|
// It is assumed that there are default parameters for all supported parameters
|
||||||
|
if (this->params.find(param.first) != this->params.end()) {
|
||||||
this->params[param.first] = param.second;
|
this->params[param.first] = param.second;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
LOGWARN("%s", string("Ignored unknown parameter '" + param.first + "'").c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Device::SetStatusCode(int status_code)
|
void Device::SetStatusCode(int status_code)
|
||||||
|
Loading…
Reference in New Issue
Block a user