Multiple substring interceptors

This commit is contained in:
2024-11-21 15:04:21 +08:00
parent 6ac7afd4c2
commit b9abf6c7d3
6 changed files with 243 additions and 88 deletions

View File

@@ -3,6 +3,7 @@
#include "logging-core.h"
#include "logging-handler.h"
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
@@ -11,9 +12,13 @@ extern "C" {
typedef struct log_Interceptor {
log_level level;
log_Handler *handler;
bool (*_dispose)(char *level, const char *message, ...);
bool jump_out;
bool (*_dispose)(struct log_Interceptor *Interceptor,
char *level,
const char *message,
...);
void (*_free)(struct log_Interceptor *Interceptor);
struct log_Interceptor *next;
} log_Interceptor;
/**
@@ -25,9 +30,9 @@ typedef struct log_Interceptor {
* @return log_Interceptor *
*/
log_Interceptor *loggingSubStringInterceptor(char *keywords[],
int count,
log_level level,
log_Handler *handler);
log_Handler *handler,
bool jump_out);
#ifdef __cplusplus
}