X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Ffilter_log.cpp;h=96a6f7dafe24e0c3c38b7705beb02c9e0cd61ae0;hb=891f355967146e1f2d66e4dc44158a011282c87f;hp=86ee793b94218cfb4fc99ea29a011bfbe507f4e8;hpb=ad428707d2a52bbe4db21e47c5ebb26e13598484;p=metaproxy-moved-to-github.git diff --git a/src/filter_log.cpp b/src/filter_log.cpp index 86ee793..96a6f7d 100644 --- a/src/filter_log.cpp +++ b/src/filter_log.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_log.cpp,v 1.11 2006-01-04 11:55:31 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,6 +96,23 @@ 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;