Give log channels fancier names
Improve LOG_CHANNEL macro to accept custom name.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
#include <typeinfo>
|
||||
#include <charconv>
|
||||
|
||||
LOG_CHANNEL(cfg_log);
|
||||
LOG_CHANNEL(cfg_log, "CFG");
|
||||
|
||||
namespace cfg
|
||||
{
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
#define CAN_OVERCOMMIT
|
||||
#endif
|
||||
|
||||
LOG_CHANNEL(jit_log);
|
||||
LOG_CHANNEL(jit_log, "JIT");
|
||||
|
||||
static u8* get_jit_memory()
|
||||
{
|
||||
|
||||
+13
-1
@@ -101,9 +101,21 @@ namespace logs
|
||||
|
||||
// Get all registered log channels
|
||||
std::vector<std::string> get_channels();
|
||||
|
||||
// Helper: no additional name specified
|
||||
constexpr const char* make_channel_name(const char* name)
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
// Helper: special channel name specified
|
||||
constexpr const char* make_channel_name(const char*, const char* name, ...)
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
#define LOG_CHANNEL(ch) inline ::logs::channel ch(#ch)
|
||||
#define LOG_CHANNEL(ch, ...) inline ::logs::channel ch(::logs::make_channel_name(#ch, ##__VA_ARGS__))
|
||||
|
||||
// Legacy:
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#include "Log.h"
|
||||
|
||||
LOG_CHANNEL(sig_log);
|
||||
LOG_CHANNEL(vm_log);
|
||||
LOG_CHANNEL(vm_log, "VM");
|
||||
|
||||
thread_local u64 g_tls_fault_all = 0;
|
||||
thread_local u64 g_tls_fault_rsx = 0;
|
||||
|
||||
Reference in New Issue
Block a user