add a filter to loggers
events are accepted by the logger if the filter accepts them the filter is optional (no filter means to accept all events)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "event.h"
|
||||
#include "database.h"
|
||||
#include "handler.h"
|
||||
#include "filter/filter.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -15,6 +16,9 @@ static void _event(void *p, event e)
|
||||
struct timelog *l = p;
|
||||
int i;
|
||||
|
||||
if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0)
|
||||
return;
|
||||
|
||||
for (i = 0; i < l->common.vsize; i++)
|
||||
l->common.v[i]->append(l->common.v[i], e.sending_time);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user