diff --git a/inc/framework/common/debug/ge_log.h b/inc/framework/common/debug/ge_log.h index d5b673c4..1b293201 100644 --- a/inc/framework/common/debug/ge_log.h +++ b/inc/framework/common/debug/ge_log.h @@ -21,6 +21,7 @@ #include "framework/common/ge_inner_error_codes.h" #include "toolchain/slog.h" + #ifdef __GNUC__ #include #include @@ -35,21 +36,20 @@ extern "C" { #define GE_MODULE_NAME static_cast(GE) // trace status of log -enum TraceStatus { TRACE_INIT = 0, TRACE_RUNNING, TRACE_WAITING, TRACE_STOP }; +enum TraceStatus { + TRACE_INIT = 0, TRACE_RUNNING, TRACE_WAITING, TRACE_STOP +}; class GeLog { -public: + public: + static uint64_t GetTid() { #ifdef __GNUC__ -static uint64_t GetTid() { - thread_local static uint64_t tid = static_cast(syscall(__NR_gettid)); - return tid; -} + thread_local static uint64_t tid = static_cast(syscall(__NR_gettid)); #else -static uint64_t GetTid() { - thread_local static uint64_t tid = static_cast(GetCurrentThreadId()); - return tid; -} + thread_local static uint64_t tid = static_cast(GetCurrentThreadId()); #endif + return tid; + } }; inline bool IsLogEnable(int module_name, int log_level) {