add log level

This commit is contained in:
liuwentan
2023-03-28 15:41:24 +08:00
parent e98627c9e7
commit 4eee0ede80
4 changed files with 312 additions and 68 deletions

View File

@@ -78,6 +78,14 @@ struct ipv6_tuple {
int protocol;
};
enum log_level {
LOG_LEVEL_TRACE,
LOG_LEVEL_DEBUG,
LOG_LEVEL_INFO,
LOG_LEVEL_WARN,
LOG_LEVEL_ERROR,
LOG_LEVEL_FATAL
};
/* update_type: MAAT_UPDATE_TYPE_FULL or MAAT_UPDATE_TYPE_INC */
typedef void maat_start_callback_t(int update_type, void *u_param);
typedef void maat_update_callback_t(int table_id, const char *table_line, void *u_para);
@@ -101,7 +109,7 @@ int maat_options_set_gc_timeout_ms(struct maat_options *opts, int interval_ms);
int maat_options_set_instance_name(struct maat_options *opts, const char *instance_name);
int maat_options_set_deferred_load_on(struct maat_options *opts);
int maat_options_set_foreign_cont_dir(struct maat_options *opts, const char *dir);
int maat_options_set_logger_path(struct maat_options *opts, const char *log_path);
int maat_options_set_logger(struct maat_options *opts, const char *log_path, enum log_level level);
int maat_options_set_iris(struct maat_options *opts, const char *full_directory,
const char *increment_directory);