[demo] Update the windows demo and support the new file plugin.
parent
29bc4e5ee5
commit
b67a5257c2
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* This file is part of the EasyLogger Library.
|
||||
*
|
||||
* Copyright (c) 2015-2019, Qintl, <qintl_linux@163.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* 'Software'), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Function: It is the configure head file for this flash log plugin.
|
||||
* Created on: 2019-01-05
|
||||
*/
|
||||
|
||||
#ifndef _ELOG_FILE_CFG_H_
|
||||
#define _ELOG_FILE_CFG_H_
|
||||
|
||||
/* EasyLogger file log plugin's using file name */
|
||||
#define ELOG_FILE_NAME "logs/elog_file.log"
|
||||
|
||||
/* EasyLogger file log plugin's using file max size */
|
||||
#define ELOG_FILE_MAX_SIZE (1 * 1024 * 1024)
|
||||
|
||||
/* EasyLogger file log plugin's using max rotate file count */
|
||||
#define ELOG_FILE_MAX_ROTATE 10
|
||||
|
||||
#endif /* _ELOG_FILE_CFG_H_ */
|
||||
@ -0,0 +1,65 @@
|
||||
/*
|
||||
* This file is part of the EasyLogger Library.
|
||||
*
|
||||
* Copyright (c) 2015-2019, Qintl, <qintl_linux@163.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* 'Software'), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Function: Portable interface for EasyLogger's file log pulgin.
|
||||
* Created on: 2019-01-05
|
||||
*/
|
||||
|
||||
#include <elog_file.h>
|
||||
|
||||
/**
|
||||
* EasyLogger flile log pulgin port initialize
|
||||
*
|
||||
* @return result
|
||||
*/
|
||||
ElogErrCode elog_file_port_init(void) {
|
||||
ElogErrCode result = ELOG_NO_ERR;
|
||||
|
||||
/* do noting, using elog_port.c's locker only */
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* file log lock
|
||||
*/
|
||||
void elog_file_port_lock(void)
|
||||
{
|
||||
/* do noting, using elog_port.c's locker only */
|
||||
}
|
||||
|
||||
/**
|
||||
* file log unlock
|
||||
*/
|
||||
void elog_file_port_unlock(void)
|
||||
{
|
||||
/* do noting, using elog_port.c's locker only */
|
||||
}
|
||||
/**
|
||||
* file log deinit
|
||||
*/
|
||||
void elog_file_port_deinit(void)
|
||||
{
|
||||
/* do noting, using elog_port.c's locker only */
|
||||
}
|
||||
@ -1,5 +1,7 @@
|
||||
gcc -I "easylogger\inc" -I "..\..\..\easylogger\inc" -O0 -g3 -Wall -c "..\..\..\easylogger\src\elog.c" -o "out\elog.o"
|
||||
gcc -I "easylogger\inc" -I "..\..\..\easylogger\inc" -O0 -g3 -Wall -c "easylogger\port\elog_port.c" -o "out\elog_port.o"
|
||||
gcc -I "easylogger\inc" -I "..\..\..\easylogger\inc" -I "..\..\..\easylogger\plugins\file" -O0 -g3 -Wall -c "easylogger\port\elog_port.c" -o "out\elog_port.o"
|
||||
gcc -I "easylogger\inc" -I "..\..\..\easylogger\inc" -O0 -g3 -Wall -c "..\..\..\easylogger\src\elog_utils.c" -o "out\elog_utils.o"
|
||||
gcc -I "easylogger\inc" -I "..\..\..\easylogger\inc" -O0 -g3 -Wall -c "..\..\..\easylogger\plugins\file\elog_file.c" -o "out\elog_file.o"
|
||||
gcc -I "easylogger\inc" -I "..\..\..\easylogger\inc" -I "..\..\..\easylogger\plugins\file" -O0 -g3 -Wall -c "..\..\..\easylogger\plugins\file\elog_file_port.c" -o "out\elog_file_port.o"
|
||||
gcc -I "easylogger\inc" -I "..\..\..\easylogger\inc" -O0 -g3 -Wall -c "main.c" -o "out\main.o"
|
||||
gcc -o out\EasyLoggerWinDemo.exe "out\main.o" "out\elog_utils.o" "out\elog.o" "out\elog_port.o" -lpthread
|
||||
gcc -o out\EasyLoggerWinDemo.exe "out\main.o" "out\elog_utils.o" "out\elog.o" "out\elog_port.o" "out\elog_file.o" "out\elog_file_port.o" -lpthread
|
||||
|
||||
Loading…
Reference in New Issue