Browse Source

Format inc/framework/common/debug/ge_log.h

pull/1002/head
zhangxiaokun 5 years ago
parent
commit
92a611f396
1 changed files with 10 additions and 10 deletions
  1. +10
    -10
      inc/framework/common/debug/ge_log.h

+ 10
- 10
inc/framework/common/debug/ge_log.h View File

@@ -21,6 +21,7 @@

#include "framework/common/ge_inner_error_codes.h"
#include "toolchain/slog.h"

#ifdef __GNUC__
#include <unistd.h>
#include <sys/syscall.h>
@@ -35,21 +36,20 @@ extern "C" {
#define GE_MODULE_NAME static_cast<int>(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<uint64_t>(syscall(__NR_gettid));
return tid;
}
thread_local static uint64_t tid = static_cast<uint64_t>(syscall(__NR_gettid));
#else
static uint64_t GetTid() {
thread_local static uint64_t tid = static_cast<uint64_t>(GetCurrentThreadId());
return tid;
}
thread_local static uint64_t tid = static_cast<uint64_t>(GetCurrentThreadId());
#endif
return tid;
}
};

inline bool IsLogEnable(int module_name, int log_level) {


Loading…
Cancel
Save