mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-27 05:04:01 +08:00
output func name in debug log
This commit is contained in:
parent
30ea713ad8
commit
28cdb2c74e
@ -192,7 +192,8 @@ static inline void reset_LastError()
|
||||
auto __prnt_dbg_ms = std::chrono::duration_cast<std::chrono::duration<unsigned long long, std::milli>>(__prnt_dbg_duration); \
|
||||
auto __prnt_dbg_f = fopen(dbg_log_file.c_str(), "a"); \
|
||||
if (!__prnt_dbg_f) break; \
|
||||
fprintf(__prnt_dbg_f, "[%llu ms, %llu us] [tid %lu] " a, __prnt_dbg_ms.count(), __prnt_dbg_micro.count(), GetCurrentThreadId(), __VA_ARGS__); \
|
||||
fprintf(__prnt_dbg_f, "[%llu ms, %llu us] [tid %lu] %s() " a "\n", \
|
||||
__prnt_dbg_ms.count(), __prnt_dbg_micro.count(), GetCurrentThreadId(), __FUNCTION__, __VA_ARGS__); \
|
||||
fclose(__prnt_dbg_f); \
|
||||
WSASetLastError(0); \
|
||||
} while (0)
|
||||
@ -205,14 +206,22 @@ static inline void reset_LastError()
|
||||
auto __prnt_dbg_ms = std::chrono::duration_cast<std::chrono::duration<unsigned long long, std::milli>>(__prnt_dbg_duration); \
|
||||
auto __prnt_dbg_f = fopen(dbg_log_file.c_str(), "a"); \
|
||||
if (!__prnt_dbg_f) break; \
|
||||
fprintf(__prnt_dbg_f, "[%llu ms, %llu us] [tid %ld] " a, __prnt_dbg_ms.count(), __prnt_dbg_micro.count(), syscall(SYS_gettid), ##__VA_ARGS__); \
|
||||
fprintf(__prnt_dbg_f, "[%llu ms, %llu us] [tid %ld] %s() " a "\n", \
|
||||
__prnt_dbg_ms.count(), __prnt_dbg_micro.count(), syscall(SYS_gettid), __FUNCTION__, ##__VA_ARGS__); \
|
||||
fclose(__prnt_dbg_f); \
|
||||
} while (0)
|
||||
#else
|
||||
#warning "Unrecognized OS, cannot set debug print"
|
||||
#define PRINT_DEBUG(...)
|
||||
#endif
|
||||
#else // EMU_RELEASE_BUILD
|
||||
#define PRINT_DEBUG(...)
|
||||
#endif // EMU_RELEASE_BUILD
|
||||
|
||||
// function entry
|
||||
#define PRINT_DEBUG_ENTRY() PRINT_DEBUG("")
|
||||
#define PRINT_DEBUG_TODO() PRINT_DEBUG("// TODO")
|
||||
|
||||
// Emulator includes
|
||||
// add them here after the inline functions definitions
|
||||
#include "net.pb.h"
|
||||
|
Loading…
Reference in New Issue
Block a user