fix event fun

This commit is contained in:
lnk
2025-09-10 17:09:12 +08:00
parent 124df41911
commit 5d20597993
2 changed files with 26 additions and 19 deletions

View File

@@ -50,19 +50,16 @@ extern std::string subdir;
//日志主题
extern std::string G_LOG_TOPIC;
//////////////////////////////////////////////////////////
/* log4.cpp 顶部 */
#if __cplusplus >= 201103L
thread_local int g_log_code_tls = 0;
#else
__thread int g_log_code_tls = 0;
#endif
////////////////////////////////////////////////////////辅助函数
/*std::string get_front_type_from_subdir() {
if (subdir == "cfg_3s_data")
return "realTime";
else if (subdir == "cfg_soe_comtrade")
return "comtrade";
else if (subdir == "cfg_recallhis_data")
return "recall";
else if (subdir == "cfg_stat_data")
return "stat";
else
return "unknown";
}*/
// 递归创建目录
bool create_directory_recursive(const std::string& path) {
@@ -129,10 +126,6 @@ bool DebugSwitch::match(const std::string& logger_name, int level, int logtype)
std::map<std::string, TypedLogger> logger_map;
DebugSwitch g_debug_switch;
// ★新增:定义 TLS 变量,默认 0
thread_local int g_log_code_tls = 0;
class SendAppender : public Appender {
protected:
void append(const spi::InternalLoggingEvent& event) {