From fd21dfe75316f909f23ae35d1bf582b85dec15eb Mon Sep 17 00:00:00 2001 From: armink Date: Sat, 27 Jun 2020 11:17:54 +0800 Subject: [PATCH] [demo][linux] Update for file plugin changes. --- demo/os/linux/Makefile | 3 +-- .../os/linux/easylogger/{plugins/file => inc}/elog_file_cfg.h | 4 ++-- .../linux/easylogger/{plugins/file => port}/elog_file_port.c | 4 ++-- demo/os/linux/easylogger/port/elog_port.c | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) rename demo/os/linux/easylogger/{plugins/file => inc}/elog_file_cfg.h (95%) rename demo/os/linux/easylogger/{plugins/file => port}/elog_file_port.c (98%) diff --git a/demo/os/linux/Makefile b/demo/os/linux/Makefile index 25cf136..f49cd49 100755 --- a/demo/os/linux/Makefile +++ b/demo/os/linux/Makefile @@ -1,14 +1,13 @@ CC = cc ROOTPATH=../../.. -INCLUDE = -I./easylogger/inc -I./easylogger/plugins/ -I$(ROOTPATH)/easylogger/plugins/ -I$(ROOTPATH)/easylogger/inc +INCLUDE = -I./easylogger/inc -I$(ROOTPATH)/easylogger/inc -I$(ROOTPATH)/easylogger/plugins/file LIB=-lpthread OBJ += $(patsubst %.c, %.o, $(wildcard *.c)) OBJ += $(patsubst %.c, %.o, $(wildcard $(ROOTPATH)/easylogger/src/*.c)) OBJ += $(patsubst %.c, %.o, $(wildcard $(ROOTPATH)/easylogger/plugins/file/elog_file.c)) OBJ += $(patsubst %.c, %.o, $(wildcard easylogger/port/*.c)) -OBJ += $(patsubst %.c, %.o, $(wildcard easylogger/plugins/file/*.c)) CFLAGS = -O0 -g3 -Wall target = EasyLoggerLinuxDemo diff --git a/demo/os/linux/easylogger/plugins/file/elog_file_cfg.h b/demo/os/linux/easylogger/inc/elog_file_cfg.h similarity index 95% rename from demo/os/linux/easylogger/plugins/file/elog_file_cfg.h rename to demo/os/linux/easylogger/inc/elog_file_cfg.h index f43f98a..b3b8f22 100644 --- a/demo/os/linux/easylogger/plugins/file/elog_file_cfg.h +++ b/demo/os/linux/easylogger/inc/elog_file_cfg.h @@ -33,9 +33,9 @@ #define ELOG_FILE_NAME "/tmp/elog_file.log" /* EasyLogger file log plugin's using file max size */ -#define ELOG_FILE_MAX_SIZE (10 * 1024 * 1024) +#define ELOG_FILE_MAX_SIZE (1 * 1024 * 1024) /* EasyLogger file log plugin's using max rotate file count */ -#define ELOG_FILE_MAX_ROTATE 10 +#define ELOG_FILE_MAX_ROTATE 5 #endif /* _ELOG_FILE_CFG_H_ */ diff --git a/demo/os/linux/easylogger/plugins/file/elog_file_port.c b/demo/os/linux/easylogger/port/elog_file_port.c similarity index 98% rename from demo/os/linux/easylogger/plugins/file/elog_file_port.c rename to demo/os/linux/easylogger/port/elog_file_port.c index b3fbec0..a08347e 100644 --- a/demo/os/linux/easylogger/plugins/file/elog_file_port.c +++ b/demo/os/linux/easylogger/port/elog_file_port.c @@ -35,8 +35,8 @@ #include -#include -#include +#include +#include #define ELOG_FILE_SEM_KEY ((key_t)0x19910612) #ifdef _SEM_SEMUN_UNDEFINED diff --git a/demo/os/linux/easylogger/port/elog_port.c b/demo/os/linux/easylogger/port/elog_port.c index 0721b05..cde29bc 100644 --- a/demo/os/linux/easylogger/port/elog_port.c +++ b/demo/os/linux/easylogger/port/elog_port.c @@ -33,7 +33,7 @@ #include #ifdef ELOG_FILE_ENABLE -#include +#include #endif static pthread_mutex_t output_lock;