|
|
@ -35,9 +35,7 @@ |
|
|
#include "rd_time.h" |
|
|
#include "rd_time.h" |
|
|
#include "rd_thread.h" |
|
|
#include "rd_thread.h" |
|
|
|
|
|
|
|
|
#ifndef DEBUG |
|
|
|
|
|
#include "elog_file.h" |
|
|
#include "elog_file.h" |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
static pthread_mutex_t output_lock; |
|
|
static pthread_mutex_t output_lock; |
|
|
|
|
|
|
|
|
@ -49,9 +47,7 @@ static pthread_mutex_t output_lock; |
|
|
WEAK ElogErrCode elog_port_init(void) { |
|
|
WEAK ElogErrCode elog_port_init(void) { |
|
|
ElogErrCode result = ELOG_NO_ERR; |
|
|
ElogErrCode result = ELOG_NO_ERR; |
|
|
Rd_MutexInit(&output_lock); |
|
|
Rd_MutexInit(&output_lock); |
|
|
#ifndef DEBUG |
|
|
|
|
|
elog_file_init(); |
|
|
elog_file_init(); |
|
|
#endif |
|
|
|
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -60,9 +56,7 @@ WEAK ElogErrCode elog_port_init(void) { |
|
|
* |
|
|
* |
|
|
*/ |
|
|
*/ |
|
|
WEAK void elog_port_deinit(void) { |
|
|
WEAK void elog_port_deinit(void) { |
|
|
#ifndef DEBUG |
|
|
|
|
|
elog_file_deinit(); |
|
|
elog_file_deinit(); |
|
|
#endif |
|
|
|
|
|
Rd_MutexDestroy(&output_lock); |
|
|
Rd_MutexDestroy(&output_lock); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -73,11 +67,7 @@ WEAK void elog_port_deinit(void) { |
|
|
* @param size log size |
|
|
* @param size log size |
|
|
*/ |
|
|
*/ |
|
|
WEAK void elog_port_output(const char *log, size_t size) { |
|
|
WEAK void elog_port_output(const char *log, size_t size) { |
|
|
#ifdef DEBUG |
|
|
|
|
|
RD_PRINTF("%.*s", (int)size, log); |
|
|
|
|
|
#else |
|
|
|
|
|
elog_file_write(log, size); |
|
|
elog_file_write(log, size); |
|
|
#endif |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
|