<?xml version="1.0"?>
-<!-- $Id: config1.xml,v 1.7 2006-01-09 21:19:11 adam Exp $ -->
+<!-- $Id: config1.xml,v 1.8 2006-01-11 08:53:52 adam Exp $ -->
<yp2 xmlns="http://indexdata.dk/yp2/config/1">
<start route="start"/>
<filters>
<routes>
<route id="start">
<filter refid="frontend"/>
+ <filter type="log">
+ <message>F</message>
+ </filter>
<filter type="virt_db">
<virtual>
<database>loc</database>
<database>idgils</database>
<target>indexdata.dk/gils</target>
</virtual>
+ <virtual>
+ <database>Default</database>
+ <target>localhost:9999</target>
+ </virtual>
+ </filter>
+ <filter type="log">
+ <message>B</message>
</filter>
- <filter type="log"/>
<filter refid="backend"/>
</route>
</routes>
-/* $Id: filter_log.cpp,v 1.13 2006-01-09 21:20:15 adam Exp $
+/* $Id: filter_log.cpp,v 1.14 2006-01-11 08:53:52 adam Exp $
Copyright (c) 2005, Index Data.
%LICENSE%
#include "config.hpp"
-#include "filter.hpp"
+#include "xmlutil.hpp"
#include "package.hpp"
#include <string>
}
}
+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;
-/* $Id: filter_log.hpp,v 1.12 2006-01-04 11:55:31 adam Exp $
+/* $Id: filter_log.hpp,v 1.13 2006-01-11 08:53:52 adam Exp $
Copyright (c) 2005, Index Data.
%LICENSE%
Log(const std::string &x);
~Log();
void process(yp2::Package & package) const;
+ void configure(const xmlNode * ptr);
};
}
}