Commit d8cd8b68 authored by Francis Dupont's avatar Francis Dupont
Browse files

[5267] Fixed LoggingInfo::toElement

parent cdfbc195
......@@ -161,14 +161,16 @@ LoggingInfo::toElement() const {
ElementPtr result = Element::createMap();
// Set name
result->set("name", Element::create(name_));
// Set output_options
ElementPtr options = Element::createList();
for (std::vector<LoggingDestination>::const_iterator dest =
destinations_.cbegin();
dest != destinations_.cend(); ++dest) {
options->add(dest->toElement());
// Set output_options if not empty
if (!destinations_.empty()) {
ElementPtr options = Element::createList();
for (std::vector<LoggingDestination>::const_iterator dest =
destinations_.cbegin();
dest != destinations_.cend(); ++dest) {
options->add(dest->toElement());
}
result->set("output_options", options);
}
result->set("output_options", options);
// Set severity
std::string severity;
switch (severity_) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment