* #将拦截器改名为过滤器,更加接近职能
This commit is contained in:
youmetme
2024-11-23 08:47:48 +08:00
committed by GitHub
parent f0c3a5d56a
commit 064881c0ad
16 changed files with 166 additions and 160 deletions

View File

@@ -2,19 +2,19 @@
#include <stdio.h>
#include <stdlib.h>
static void __freeConsoleHandler(log_Handler *handler) { free(handler); }
static void __freeHandlerConsole(log_Handler *handler) { free(handler); }
static void outputConsoleHandler(log_Handler *handler, const char *message) {
static void __outputHandlerConsole(log_Handler *handler, const char *message) {
fputs(message, handler->stream);
}
log_Handler *loggingConsoleHandler() {
log_Handler *loggingHandlerConsole() {
log_Handler *handler = (log_Handler *)malloc(sizeof(log_Handler));
handler->stream = stdout;
handler->apply_color = true;
handler->_free = __freeConsoleHandler;
handler->output = outputConsoleHandler;
handler->_free = __freeHandlerConsole;
handler->output = __outputHandlerConsole;
return handler;
}