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 { ...@@ -161,14 +161,16 @@ LoggingInfo::toElement() const {
ElementPtr result = Element::createMap(); ElementPtr result = Element::createMap();
// Set name // Set name
result->set("name", Element::create(name_)); result->set("name", Element::create(name_));
// Set output_options // Set output_options if not empty
ElementPtr options = Element::createList(); if (!destinations_.empty()) {
for (std::vector<LoggingDestination>::const_iterator dest = ElementPtr options = Element::createList();
destinations_.cbegin(); for (std::vector<LoggingDestination>::const_iterator dest =
dest != destinations_.cend(); ++dest) { destinations_.cbegin();
options->add(dest->toElement()); dest != destinations_.cend(); ++dest) {
options->add(dest->toElement());
}
result->set("output_options", options);
} }
result->set("output_options", options);
// Set severity // Set severity
std::string severity; std::string severity;
switch (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