Fixing logging filter "include" and "exclude" options.

This commit is contained in:
Robin Sommer 2011-04-17 11:14:07 -07:00
parent 58f86ae55d
commit 09d37b2026
6 changed files with 95 additions and 7 deletions

View file

@ -553,8 +553,6 @@ bool LogMgr::TraverseRecord(Stream* stream, Filter* filter, RecordType* rt, Tabl
else
new_path = path + "." + rt->FieldName(i);
StringVal* new_path_val = new StringVal(path.c_str());
if ( t->InternalType() == TYPE_INTERNAL_OTHER )
{
if ( t->Tag() == TYPE_RECORD )
@ -585,15 +583,25 @@ bool LogMgr::TraverseRecord(Stream* stream, Filter* filter, RecordType* rt, Tabl
// If include fields are specified, only include if explicitly listed.
if ( include )
{
if ( ! include->Lookup(new_path_val) )
return true;
StringVal* new_path_val = new StringVal(new_path.c_str());
bool result = include->Lookup(new_path_val);
Unref(new_path_val);
if ( ! result )
continue;
}
// If exclude fields are specified, do not only include if listed.
if ( exclude )
{
if ( exclude->Lookup(new_path_val) )
return true;
StringVal* new_path_val = new StringVal(new_path.c_str());
bool result = exclude->Lookup(new_path_val);
Unref(new_path_val);
if ( result )
continue;
}
// Alright, we want this field.