#将拦截器改名为过滤器,更加接近职能
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ static void outputFileHandler(log_Handler *handler, const char *message) {
|
||||
changeFile(handler);
|
||||
}
|
||||
|
||||
log_Handler *loggingFileHandler(const char *name, unsigned int max_size) {
|
||||
log_Handler *loggingHandlerFile(const char *name, unsigned int max_size) {
|
||||
char new_file_name[FILE_NAME_MAX_SIZE];
|
||||
int suffix = 0;
|
||||
unsigned int file_size;
|
||||
|
||||
Reference in New Issue
Block a user