1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
//#define XERR
#include "current.ih"
#include <ostream>
namespace
{
char const *s_action[] =
{
"ACCEPT",
"IGNORE",
"SPAM",
};
}
void Current::log(eAction type)
{
Log &log = Log::instance();
if (d_rulesLine == string::npos)
return;
log << "Rules line " << d_rulesLine << " (" << s_action[type] << "): ";
for (Data const &data: d_data)
{
log << data.filename << " header `" << data.header << "' ";
if (data.idx == string::npos)
log << "no match; ";
else
log << "matched by rule " << data.idx << "; ";
}
log << endl;
d_rulesLine = string::npos;
}
|