summaryrefslogtreecommitdiff
path: root/lib/zlog_targets.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2019-12-17 13:05:32 +0100
committerDavid Lamparter <equinox@diac24.net>2020-04-01 06:53:26 +0200
commit1c4086281f72fd8b6fdf824a6edfaebe1871e383 (patch)
tree32a7b4570fd89f998ebb8d7c8c085d2b1dee9e2f /lib/zlog_targets.c
parent0eb5f93863c40f6ca906bc6273795982c1359efc (diff)
lib/log: re-add log filtering
This is most of the old code bolted on top of the new "backend" infrastructure. It just wraps around zlog_fd() with the string search. Originally-by: Stephen Worley <sworley@cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'lib/zlog_targets.c')
-rw-r--r--lib/zlog_targets.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/zlog_targets.c b/lib/zlog_targets.c
index 85991b0dde..b23ab073b4 100644
--- a/lib/zlog_targets.c
+++ b/lib/zlog_targets.c
@@ -61,7 +61,7 @@ static const char * const prionames[] = {
[LOG_DEBUG] = "debugging: ",
};
-static void zlog_fd(struct zlog_target *zt, struct zlog_msg *msgs[], size_t nmsgs)
+void zlog_fd(struct zlog_target *zt, struct zlog_msg *msgs[], size_t nmsgs)
{
struct zlt_fd *zte = container_of(zt, struct zlt_fd, zt);
int fd;
@@ -221,7 +221,7 @@ static bool zlog_file_cycle(struct zlog_cfg_file *zcf)
zlt->ts_subsec = zcf->ts_subsec;
zlt->zt.prio_min = zcf->prio_min;
- zlt->zt.logfn = zlog_fd;
+ zlt->zt.logfn = zcf->zlog_wrap ? zcf->zlog_wrap : zlog_fd;
zlt->zt.logfn_sigsafe = zlog_fd_sigsafe;
} while (0);