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 不支持中文注释,删除中文注释
This commit is contained in:
youmetme
2024-11-02 20:26:04 +08:00
committed by GitHub
parent b7f49188ad
commit 3ef229ed65
17 changed files with 71 additions and 127 deletions

View File

@@ -8,7 +8,7 @@
#include "logging/logging-handler.h"
#include "logging/logging-interceptor.h"
// 日志操作器
typedef struct Logger {
log_level level;
log_Handler *handler;
@@ -24,7 +24,7 @@ typedef struct Logger {
void (*addInterceptor)(log_Interceptor *Interceptor);
} Logger;
// 日志类对象
typedef struct Logging {
Logger *(*getLogger)(const char *name, log_level level);
log_status (*setLevel)(Logger *logger, log_level level);
@@ -32,6 +32,6 @@ typedef struct Logging {
log_status (*destroyLogging)(struct Logging *logging);
} Logging;
Logging *newLogging(); // 创建日志类对象
Logging *newLogging();
#endif // __LOGGING_H__

View File

@@ -14,5 +14,4 @@ typedef enum {
L_OK,
} log_status;
#endif // __LOGGING_CORE_H__

View File

@@ -4,14 +4,13 @@
#include <stdbool.h>
typedef struct log_Handler {
void* stream;
bool apply_color;
void (*_free)(struct log_Handler* handler);//释放资源
void (*output)(struct log_Handler* handler,const char* message);
void *stream;
bool apply_color;
void (*_free)(struct log_Handler *handler);
void (*output)(struct log_Handler *handler, const char *message);
} log_Handler;
log_Handler *loggingFileHandler(const char *name);
log_Handler *loggingConsoleHandler();
log_Handler* loggingFileHandler(const char* name);
log_Handler* loggingConsoleHandler();
#endif //__LOGGING_HANDLER_H__
#endif //__LOGGING_HANDLER_H__

View File

@@ -5,10 +5,10 @@
#include "logging-handler.h"
typedef struct log_Interceptor {
log_level level; // 拦截级别
log_Handler *handler; // 拦截目标处理器
bool (*_dispose)(char *level, const char *message, ...); // 拦截触发器
void (*_free)(struct log_Interceptor *Interceptor); // 释放资源
log_level level;
log_Handler *handler;
bool (*_dispose)(char *level, const char *message, ...);
void (*_free)(struct log_Interceptor *Interceptor);
} log_Interceptor;