| 471 | } |
| 472 | |
| 473 | void |
| 474 | LogEventBase::write (std::ostream &os, bool with_endl) const |
| 475 | { |
| 476 | std::vector< std::pair<std::string, std::string> > attrs; |
| 477 | attributes (attrs); |
| 478 | |
| 479 | os << " <" << name (); |
| 480 | for (std::vector< std::pair<std::string, std::string> >::const_iterator a = attrs.begin (); a != attrs.end (); ++a) { |
| 481 | os << " " << a->first << "=\"" << a->second << "\""; |
| 482 | } |
| 483 | |
| 484 | if (! data ().is_nil () && ! (data ().is_list () && data ().get_list ().empty ())) { |
| 485 | os << ">" << std::endl; |
| 486 | if (data ().is_list ()) { |
| 487 | for (tl::Variant::const_iterator b = data ().begin (); b != data ().end (); ++b) { |
| 488 | write_data (*b, os, 2); |
| 489 | } |
| 490 | } else { |
| 491 | write_data (data (), os, 2); |
| 492 | } |
| 493 | os << " </" << name () << ">"; |
| 494 | } else { |
| 495 | os << "/>"; |
| 496 | } |
| 497 | |
| 498 | if (with_endl) { |
| 499 | os << std::endl; |
| 500 | } |
| 501 | |
| 502 | } |
| 503 | |
| 504 | // -------------------------------------------------------------- |
| 505 | // The log event specializations |
no test coverage detected