2023-08-29 18:31:57 +02:00
|
|
|
#include "vk_logs.h"
|
|
|
|
#include "vk_cvar.h"
|
|
|
|
|
|
|
|
uint32_t g_log_debug_bits = 0;
|
|
|
|
|
|
|
|
static const struct log_pair_t {
|
|
|
|
const char *name;
|
|
|
|
uint32_t bit;
|
|
|
|
} g_log_module_pairs[] = {
|
2023-08-29 19:12:35 +02:00
|
|
|
{"misc", LogModule_Misc},
|
2023-08-29 18:31:57 +02:00
|
|
|
{"tex", LogModule_Textures},
|
|
|
|
{"brush", LogModule_Brush},
|
|
|
|
{"light", LogModule_Lights},
|
|
|
|
{"studio", LogModule_Studio},
|
|
|
|
{"patch", LogModule_Patch},
|
|
|
|
{"mat", LogModule_Material},
|
2023-08-29 19:12:35 +02:00
|
|
|
{"meat", LogModule_Meatpipe},
|
|
|
|
{"rt", LogModule_RT},
|
2023-09-26 18:25:40 +02:00
|
|
|
{"rmain", LogModule_RMain},
|
|
|
|
{"sprite", LogModule_Sprite},
|
2023-08-29 18:31:57 +02:00
|
|
|
};
|
|
|
|
|
2023-11-07 17:59:12 +01:00
|
|
|
void R_LogSetVerboseModules( const char *p ) {
|
2023-08-29 18:31:57 +02:00
|
|
|
g_log_debug_bits = 0;
|
|
|
|
while (*p) {
|
|
|
|
const char *next = Q_strchrnul(p, ',');
|
|
|
|
const const_string_view_t name = {p, next - p};
|
|
|
|
uint32_t bit = 0;
|
|
|
|
|
|
|
|
for (int i = 0; i < COUNTOF(g_log_module_pairs); ++i) {
|
|
|
|
const struct log_pair_t *const pair = g_log_module_pairs + i;
|
|
|
|
if (stringViewCmp(name, pair->name) == 0) {
|
2023-11-07 17:59:12 +01:00
|
|
|
gEngine.Con_Reportf("Enabling verbose logs for module \"%.*s\"\n", name.len, name.s);
|
2023-08-29 18:31:57 +02:00
|
|
|
bit = pair->bit;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!bit) {
|
|
|
|
gEngine.Con_Reportf(S_ERROR "Unknown log module \"%.*s\"\n", name.len, name.s);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_log_debug_bits |= bit;
|
|
|
|
|
|
|
|
if (!*next)
|
|
|
|
break;
|
|
|
|
p = next + 1;
|
|
|
|
}
|
|
|
|
}
|