diff --git a/code/game/g_logger.c b/code/game/g_logger.c index fbeb9a0..0bbea7d 100644 --- a/code/game/g_logger.c +++ b/code/game/g_logger.c @@ -4,7 +4,7 @@ void QDECL G_Logger (int level, char* fmt, ...) { va_list argptr; char text[1024]; - if(level > g_logLevel.integer && g_logLevel.integer != LL_ALWAYS) { + if(level > g_logLevel.integer) { return; } @@ -15,23 +15,23 @@ void QDECL G_Logger (int level, char* fmt, ...) { switch (level) { case LL_ERROR: - G_Printf(S_COLOR_RED "[game][error] %s", text); + G_Printf(S_COLOR_RED "[game][error] - %s", text); break; case LL_WARN: - G_Printf(S_COLOR_YELLOW "[game][warn] %s", text); + G_Printf(S_COLOR_YELLOW "[game][warn ] - %s", text); break; case LL_INFO: - G_Printf("[game][info] %s", text); + G_Printf("[game][info ] %s - ", text); break; case LL_DEBUG: - G_Printf("[game][info] %s", text); + G_Printf("[game][debug] %s - ", text); break; case LL_TRACE: - G_Printf("[game][trace] %s", text); + G_Printf("[game][trace] %s - ", text); break; case LL_ALWAYS: default: - G_Printf("[game] %s", text); + G_Printf("[game] %s - ", text); break; } } @@ -40,7 +40,7 @@ void QDECL _G_LocLogger (const char* file, int line, int level, char* fmt, ...) va_list argptr; char text[1024]; - if(level > g_logLevel.integer && g_logLevel.integer != LL_ALWAYS) { + if(level > g_logLevel.integer) { return; } @@ -51,23 +51,29 @@ void QDECL _G_LocLogger (const char* file, int line, int level, char* fmt, ...) switch (level) { case LL_ERROR: - G_Printf(S_COLOR_RED "[game][error] %s:%d - ", file, line); + G_Printf(S_COLOR_RED "[game][error][%s:%d] - ", file, line); + G_Printf(S_COLOR_RED "%s", text); break; case LL_WARN: - G_Printf(S_COLOR_YELLOW "[game][warn] %s:%d - ", file, line); + G_Printf(S_COLOR_YELLOW "[game][warn ][%s:%d] - ", file, line); + G_Printf(S_COLOR_YELLOW "%s", text); break; case LL_INFO: - G_Printf("[game][info] %s:%d - ", file, line); + G_Printf("[game][info ][%s:%d] - ", file, line); + G_Printf("%s", text); break; case LL_DEBUG: - G_Printf("[game][info] %s:%d - ", file, line); + G_Printf("[game][debug][%s:%d] - ", file, line); + G_Printf("%s", text); break; case LL_TRACE: - G_Printf("[game][trace] %s:%d - ", file, line); + G_Printf("[game][trace][%s:%d] - ", file, line); + G_Printf("%s", text); break; case LL_ALWAYS: default: - G_Printf("[game] %s:%d - ", file, line); + G_Printf("[game] [%s:%d] - ", file, line); + G_Printf("%s", text); break; } } diff --git a/code/game/g_logger.h b/code/game/g_logger.h index c02810f..1c7b91a 100644 --- a/code/game/g_logger.h +++ b/code/game/g_logger.h @@ -4,12 +4,12 @@ #include "g_local.h" enum { + LL_ALWAYS, LL_ERROR, LL_WARN, LL_INFO, LL_DEBUG, - LL_TRACE, - LL_ALWAYS + LL_TRACE }; #define G_LocLogger(X,...) _G_LocLogger(__FILE__, __LINE__, X, __VA_ARGS__) diff --git a/code/game/g_main.c b/code/game/g_main.c index e983cbb..d7985b5 100644 --- a/code/game/g_main.c +++ b/code/game/g_main.c @@ -474,7 +474,7 @@ static cvarTable_t gameCvarTable[] = { { &rpg_photonDamage, "rpg_photonDamage", "140", CVAR_ARCHIVE, 0, qfalse }, { &rpg_photonAltDamage, "rpg_photonAltDamage", "140", CVAR_ARCHIVE, 0, qfalse }, { &g_developer, "g_developer", "0", CVAR_ARCHIVE, 0, qfalse }, - { &g_logLevel, "g_loglevel", "1", CVAR_ARCHIVE, 0, qfalse } + { &g_logLevel, "g_loglevel", "2", CVAR_ARCHIVE, 0, qfalse } }; static int gameCvarTableSize = (int)(sizeof( gameCvarTable ) / sizeof( gameCvarTable[0] ));