Multiple substring interceptors
This commit is contained in:
		| @@ -1,8 +1,10 @@ | ||||
| #include "logging.h" | ||||
| #include <stdbool.h> | ||||
| #include <stdio.h> | ||||
| #include <time.h> | ||||
|  | ||||
| int main() { | ||||
|     Logger  *logger = newDefaultLogger("testLogger", LOG_DEBUG); | ||||
|     Logger *logger = newDefaultLogger("testLogger", LOG_DEBUG); | ||||
|  | ||||
|     log_info("This is an info message"); | ||||
|     log_error("This is an error message%s", "123"); | ||||
| @@ -10,16 +12,26 @@ int main() { | ||||
|     log_debug("This is a debug message"); | ||||
|     log_warning("This is a warning message%s", "123"); | ||||
|  | ||||
|     char *test1[]         = {"123", "tt"}; | ||||
|     char *test1[]         = {"This",NULL}; | ||||
|  | ||||
|     log_Interceptor *tint = loggingSubStringInterceptor( | ||||
|         test1, | ||||
|         2, | ||||
|         LOG_DEBUG, | ||||
|         loggingFileHandler("test_interceptor", 1024 * 1024)); | ||||
|         loggingFileHandler("test_interceptor", 1024 * 1024), | ||||
|         false); | ||||
|  | ||||
|     logger->addInterceptor(tint); | ||||
|  | ||||
|     char *test2[]         = {"123",NULL}; | ||||
|  | ||||
|     log_Interceptor *tint1 = loggingSubStringInterceptor( | ||||
|         test2, | ||||
|         LOG_DEBUG, | ||||
|         loggingFileHandler("test_interceptor1", 1024 * 1024), | ||||
|         true); | ||||
|  | ||||
|     logger->addInterceptor(tint1); | ||||
|  | ||||
|     printf("\n"); | ||||
|     printf("Interceptor added\n"); | ||||
|     printf("\n"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user