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
+6
View File
@@ -9,3 +9,9 @@ void logger_add_view(logger *_l, view *v)
l->v = realloc(l->v, l->vsize * sizeof(view *)); if (l->v == NULL) abort();
l->v[l->vsize-1] = v;
}
void logger_set_filter(logger *_l, void *filter)
{
struct logger *l = _l;
l->filter = filter;
}