1
0
mirror of https://github.com/armink/EasyLogger.git synced 2025-01-19 07:42:52 +08:00

解决 elog_raw() 的输出无法由 ELOG_OUTPUT_ENABLE总开关 关闭的问题

This commit is contained in:
Riggin 2023-06-28 17:39:12 +08:00
parent e01ac30115
commit ad264f0df6
2 changed files with 5 additions and 3 deletions

View File

@ -73,6 +73,7 @@ extern "C" {
#endif
#ifndef ELOG_OUTPUT_ENABLE
#define elog_raw(...)
#define elog_assert(tag, ...)
#define elog_error(tag, ...)
#define elog_warn(tag, ...)
@ -80,6 +81,7 @@ extern "C" {
#define elog_debug(tag, ...)
#define elog_verbose(tag, ...)
#else /* ELOG_OUTPUT_ENABLE */
#define elog_raw(...) elog_raw_output(__VA_ARGS__)
#if ELOG_OUTPUT_LVL >= ELOG_LVL_ASSERT
#define elog_assert(tag, ...) \
elog_output(ELOG_LVL_ASSERT, tag, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
@ -191,7 +193,7 @@ void elog_set_filter_tag(const char *tag);
void elog_set_filter_kw(const char *keyword);
void elog_set_filter_tag_lvl(const char *tag, uint8_t level);
uint8_t elog_get_filter_tag_lvl(const char *tag);
void elog_raw(const char *format, ...);
void elog_raw_output(const char *format, ...);
void elog_output(uint8_t level, const char *tag, const char *file, const char *func,
const long line, const char *format, ...);
void elog_output_lock_enabled(bool enabled);

View File

@ -503,7 +503,7 @@ uint8_t elog_get_filter_tag_lvl(const char *tag)
* @param format output format
* @param ... args
*/
void elog_raw(const char *format, ...) {
void elog_raw_output(const char *format, ...) {
va_list args;
size_t log_len = 0;
int fmt_result;
@ -915,7 +915,7 @@ void elog_hexdump(const char *name, uint8_t width, const void *buf, uint16_t siz
elog_async_output(ELOG_LVL_DEBUG, log_buf, log_len);
#elif defined(ELOG_BUF_OUTPUT_ENABLE)
extern void elog_buf_output(const char *log, size_t size);
elog_buf_output(log_buf, log_len);
elog_buf_output(log_buf, log_len);
#else
elog_port_output(log_buf, log_len);
#endif