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:
Cedric Roux
2016-06-08 16:35:08 +02:00
parent 63652f94fa
commit 72f56da6b6
12 changed files with 176 additions and 4 deletions
+4
View File
@@ -3,6 +3,7 @@
#include "event.h"
#include "database.h"
#include "handler.h"
#include "filter/filter.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -21,6 +22,9 @@ static void _event(void *p, event e)
int frame;
int subframe;
if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0)
return;
frame = e.e[l->frame_arg].i;
subframe = e.e[l->subframe_arg].i;