fix event fun
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
#ifndef LOG4_H
|
||||
#define LOG4_H
|
||||
|
||||
#if defined(__cplusplus) && __cplusplus >= 201103L
|
||||
#define LOG_TLS_SPEC thread_local
|
||||
#else
|
||||
/* C 或旧编译器,走 GCC 扩展 */
|
||||
#define LOG_TLS_SPEC __thread
|
||||
#endif
|
||||
|
||||
/* ★统一的对外声明(别在其他头/源里再声明不同版本!) */
|
||||
extern LOG_TLS_SPEC int g_log_code_tls;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <string>
|
||||
@@ -73,7 +83,8 @@ void process_log_command(const std::string& id, const std::string& level, const
|
||||
|
||||
void update_log_entries_countdown();
|
||||
|
||||
|
||||
extern "C" {
|
||||
#endif
|
||||
void remove_loggers_by_terminal_id(const std::string& terminal_id_cstr);
|
||||
void init_logger_process();
|
||||
void init_loggers();
|
||||
@@ -91,7 +102,7 @@ void format_log_msg(char* buf, size_t buf_size, const char* fmt, ...);
|
||||
// 说明:使用编译器的 TLS(__thread)保存当前日志的 code 值。
|
||||
// 在每次打日志前写入,打完后恢复,Appender 读取该值写入 JSON。
|
||||
|
||||
extern int g_log_code_tls; // 声明为 TLS 变量,定义见 log4.cpp
|
||||
|
||||
// ====================== ★新增结束 ======================
|
||||
|
||||
|
||||
@@ -151,7 +162,10 @@ typedef enum LogCode {
|
||||
LOG_CODE_SPACE_ALARM = 700 /* 空间告警 */
|
||||
} LogCode;
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user