Files
logging/tests/test_interceptor.c
youmetme 3ef229ed65 Dev test on windows action (#9)
* #feat 增强Fatal级别的底色,修改logging类的方法

* 更新版本号

* 加入test脚本

* fix:conanfile

* test action

* 修复错别字

* add test on windows action

* fix test on windows action

* fix action on windows

* fix

* fix 内存分配错误

* fix msvc 不支持中文注释,删除中文注释
2024-11-02 20:26:04 +08:00

33 lines
978 B
C

#include "logging.h"
#include <stdio.h>
int main() {
Logging *log = newLogging();
Logger *logger = log->getLogger("testLogger", LOG_DEBUG);
logger->info("This is an info message");
logger->error("This is an error message%s", "123");
logger->fatal("This is an fatal message");
logger->debug("This is a debug message");
logger->warning("This is a warning message%s", "123");
char *test1[] = {"123", "tt"};
log_Interceptor *tint =
loggingSubStringInterceptor(test1, 2, LOG_DEBUG, loggingFileHandler("test_interceptor"));
logger->addInterceptor(tint);
printf("\n");
printf("Interceptor added\n");
printf("\n");
logger->info("This is an info message");
logger->error("This is an error message%s", "123");
logger->fatal("This is an fatal message");
logger->debug("This is a debug message");
logger->warning("This is a warning message%s", "123");
log->destroyLogging(log);
return 0;
}