X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Ffilter_log.cpp;h=96a6f7dafe24e0c3c38b7705beb02c9e0cd61ae0;hb=a1ef872694c141f21afdbb3e0798b60fc1421429;hp=4142be7ed88eb23a364bccb37801cc93bd38934e;hpb=63ea8aedbfd7dc56ab28dbc82c38b4458dcecb68;p=metaproxy-moved-to-github.git diff --git a/src/filter_log.cpp b/src/filter_log.cpp index 4142be7..96a6f7d 100644 --- a/src/filter_log.cpp +++ b/src/filter_log.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_log.cpp,v 1.10 2006-01-04 11:19:04 adam Exp $ +/* $Id: filter_log.cpp,v 1.15 2006-01-11 11:51:49 adam Exp $ Copyright (c) 2005, Index Data. %LICENSE% @@ -6,8 +6,6 @@ #include "config.hpp" -#include "filter.hpp" -#include "router.hpp" #include "package.hpp" #include @@ -44,7 +42,7 @@ yf::Log::Log() : m_p(new Rep) yf::Log::~Log() {} -void yf::Log::process(Package &package) const +void yf::Log::process(yp2::Package &package) const { Z_GDU *gdu; @@ -98,13 +96,30 @@ void yf::Log::process(Package &package) const } } +void yf::Log::configure(const xmlNode *ptr) +{ + for (ptr = ptr->children; ptr; ptr = ptr->next) + { + if (ptr->type != XML_ELEMENT_NODE) + continue; + if (!strcmp((const char *) ptr->name, "message")) + m_p->m_msg = yp2::xml::get_text(ptr); + else + { + throw yp2::filter::FilterException("Bad element " + + std::string((const char *) + ptr->name)); + } + } +} + static yp2::filter::Base* filter_creator() { return new yp2::filter::Log; } extern "C" { - const struct yp2_filter_struct yp2_filter_log = { + struct yp2_filter_struct yp2_filter_log = { 0, "log", filter_creator