From fb84f325b8e672ba7ca1a961f4ef01f4d011e33d Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 6 Jun 2013 07:33:54 +0200 Subject: logging: Add ability to save/print current log filters This enables the persistent configuration of let's say 'log filter imsi 012345678' for a given log file in the config file. --- include/osmocom/core/logging.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include') diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 3c5e7b15..4c893ac4 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -95,6 +95,17 @@ struct log_target; typedef int log_filter(const struct log_context *ctx, struct log_target *target); +struct log_info; +struct vty; + +typedef void log_print_filters(struct vty *vty, + const struct log_info *info, + const struct log_target *tgt); + +typedef void log_save_filters(struct vty *vty, + const struct log_info *info, + const struct log_target *tgt); + /*! \brief Logging configuration, passed to \ref log_init */ struct log_info { /* \brief filter callback function */ @@ -106,6 +117,11 @@ struct log_info { unsigned int num_cat; /*! \brief total number of user categories (not library) */ unsigned int num_cat_user; + + /* \brief filter saving function */ + log_save_filters *save_fn; + /* \brief filter saving function */ + log_print_filters *print_fn; }; /*! \brief Type of logging target */ -- cgit v1.2.3