feature:根据文件大小分割日志
This commit is contained in:
@@ -8,6 +8,9 @@
|
||||
#include "logging/logging-handler.h"
|
||||
#include "logging/logging-interceptor.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct Logger {
|
||||
log_level level;
|
||||
@@ -34,4 +37,8 @@ typedef struct Logging {
|
||||
|
||||
Logging *newLogging();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __LOGGING_H__
|
||||
@@ -1,6 +1,10 @@
|
||||
#ifndef __LOGGING_CORE_H__
|
||||
#define __LOGGING_CORE_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
LOG_FATAL,
|
||||
LOG_ERROR,
|
||||
@@ -14,4 +18,8 @@ typedef enum {
|
||||
L_OK,
|
||||
} log_status;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __LOGGING_CORE_H__
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct log_Handler {
|
||||
void *stream;
|
||||
bool apply_color;
|
||||
@@ -10,7 +14,11 @@ typedef struct log_Handler {
|
||||
void (*output)(struct log_Handler *handler, const char *message);
|
||||
} log_Handler;
|
||||
|
||||
log_Handler *loggingFileHandler(const char *name);
|
||||
log_Handler *loggingFileHandler(const char *name, unsigned int max_size);
|
||||
log_Handler *loggingConsoleHandler();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //__LOGGING_HANDLER_H__
|
||||
@@ -4,6 +4,10 @@
|
||||
#include "logging-core.h"
|
||||
#include "logging-handler.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct log_Interceptor {
|
||||
log_level level;
|
||||
log_Handler *handler;
|
||||
@@ -23,4 +27,8 @@ log_Interceptor *loggingSubStringInterceptor(char *keywords[],
|
||||
log_level level,
|
||||
log_Handler *handler);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __LOGGING_INTERCEPTOR_H__
|
||||
Reference in New Issue
Block a user