diff options
| author | David Lamparter <equinox@diac24.net> | 2019-12-17 13:05:32 +0100 | 
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2020-04-01 06:53:26 +0200 | 
| commit | 1c4086281f72fd8b6fdf824a6edfaebe1871e383 (patch) | |
| tree | 32a7b4570fd89f998ebb8d7c8c085d2b1dee9e2f /lib/log.h | |
| parent | 0eb5f93863c40f6ca906bc6273795982c1359efc (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/log.h')
| -rw-r--r-- | lib/log.h | 17 | 
1 files changed, 17 insertions, 0 deletions
@@ -32,6 +32,7 @@  #include "lib/hook.h"  #include "lib/zlog.h" +#include "lib/zlog_targets.h"  #ifdef __cplusplus  extern "C" { @@ -73,6 +74,22 @@ struct message {  extern void zlog_thread_info(int log_level); +#define ZLOG_FILTERS_MAX 100      /* Max # of filters at once */ +#define ZLOG_FILTER_LENGTH_MAX 80 /* 80 character filter limit */ + +struct zlog_cfg_filterfile { +	struct zlog_cfg_file parent; +}; + +extern void zlog_filterfile_init(struct zlog_cfg_filterfile *zcf); +extern void zlog_filterfile_fini(struct zlog_cfg_filterfile *zcf); + +/* Add/Del/Dump log filters */ +extern void zlog_filter_clear(void); +extern int zlog_filter_add(const char *filter); +extern int zlog_filter_del(const char *filter); +extern int zlog_filter_dump(char *buf, size_t max_size); +  const char *lookup_msg(const struct message *mz, int kz, const char *nf);  /* Safe version of strerror -- never returns NULL. */  | 
