2015-05-09 12:15:34 +08:00
|
|
|
/*
|
|
|
|
* This file is part of the EasyLogger Library.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2015, Armink, <armink.ztl@gmail.com>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* Function: Portable interface for each platform.
|
|
|
|
* Created on: 2015-04-28
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "elog.h"
|
2015-06-10 12:04:35 +08:00
|
|
|
/* @note If you don't use flash log plugin, you can delete this include. */
|
|
|
|
#include "elog_flash.h"
|
2015-05-09 12:15:34 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* EasyLogger port initialize
|
|
|
|
*
|
|
|
|
* @return result
|
|
|
|
*/
|
|
|
|
ElogErrCode elog_port_init(void) {
|
|
|
|
ElogErrCode result = ELOG_NO_ERR;
|
|
|
|
|
2015-06-10 12:04:35 +08:00
|
|
|
/* add your code here */
|
|
|
|
|
2015-05-09 12:15:34 +08:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* output log port interface
|
|
|
|
*/
|
|
|
|
void elog_port_output(const char *output, size_t size) {
|
2015-06-10 12:04:35 +08:00
|
|
|
|
|
|
|
/* add your code here */
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* output flash saved log port interface
|
|
|
|
*/
|
|
|
|
void elog_flash_port_output(const char *output, size_t size) {
|
|
|
|
|
|
|
|
/* If used flash log plugin, then you must implement this function. */
|
|
|
|
|
2015-05-09 12:15:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* output lock
|
|
|
|
*/
|
|
|
|
void elog_port_output_lock(void) {
|
2015-06-10 12:04:35 +08:00
|
|
|
|
|
|
|
/* add your code here */
|
|
|
|
|
2015-05-09 12:15:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* output unlock
|
|
|
|
*/
|
|
|
|
void elog_port_output_unlock(void) {
|
2015-06-10 12:04:35 +08:00
|
|
|
|
|
|
|
/* add your code here */
|
|
|
|
|
2015-05-09 12:15:34 +08:00
|
|
|
}
|
|
|
|
|
2015-06-10 12:04:35 +08:00
|
|
|
/**
|
|
|
|
* flash log lock
|
|
|
|
*/
|
|
|
|
void elog_flash_port_lock(void) {
|
|
|
|
|
|
|
|
/* If used flash log plugin, then you must implement this function. */
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* flash log unlock
|
|
|
|
*/
|
|
|
|
void elog_flash_port_unlock(void) {
|
|
|
|
|
|
|
|
/* If used flash log plugin, then you must implement this function. */
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-05-09 12:15:34 +08:00
|
|
|
/**
|
|
|
|
* get current time interface
|
|
|
|
*
|
|
|
|
* @return current time
|
|
|
|
*/
|
|
|
|
const char *elog_port_get_time(void) {
|
2015-06-10 12:04:35 +08:00
|
|
|
|
|
|
|
/* add your code here */
|
|
|
|
|
2015-05-09 12:15:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get current process name interface
|
|
|
|
*
|
|
|
|
* @return current process name
|
|
|
|
*/
|
|
|
|
const char *elog_port_get_p_info(void) {
|
2015-06-10 12:04:35 +08:00
|
|
|
|
|
|
|
/* add your code here */
|
|
|
|
|
2015-05-09 12:15:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get current thread name interface
|
|
|
|
*
|
|
|
|
* @return current thread name
|
|
|
|
*/
|
|
|
|
const char *elog_port_get_t_info(void) {
|
2015-06-10 12:04:35 +08:00
|
|
|
|
|
|
|
/* add your code here */
|
|
|
|
|
2015-05-09 12:15:34 +08:00
|
|
|
}
|