diff --git a/data/autoexec_server.cfg b/data/autoexec_server.cfg index 86c4f1b4c..8d1c1fe30 100644 --- a/data/autoexec_server.cfg +++ b/data/autoexec_server.cfg @@ -52,6 +52,9 @@ sv_register 0 # File where server log will be stored logfile "autoexec_server.log" +# Log level (0 = Error, 1 = Warn, 2 = Info, 3 = Debug, 4 = Trace) +loglevel 2 + # Folder where map records will be saved sv_score_folder "records" diff --git a/src/base/log.cpp b/src/base/log.cpp index 7b94e46e1..afd8b1408 100644 --- a/src/base/log.cpp +++ b/src/base/log.cpp @@ -3,6 +3,8 @@ #include "color.h" #include "system.h" +#include + #include #include @@ -67,6 +69,9 @@ void log_set_scope_logger(ILogger *logger) void log_log_impl(LEVEL level, bool have_color, LOG_COLOR color, const char *sys, const char *fmt, va_list args) { + if(level > g_Config.m_Loglevel) + return; + // Make sure we're not logging recursively. if(in_logger) { diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h index f27003e23..d8fd9eee4 100644 --- a/src/engine/shared/config_variables.h +++ b/src/engine/shared/config_variables.h @@ -11,6 +11,7 @@ MACRO_CONFIG_STR(PlayerClan, player_clan, 12, "", CFGFLAG_SAVE | CFGFLAG_CLIENT MACRO_CONFIG_INT(PlayerCountry, player_country, -1, -1, 1000, CFGFLAG_SAVE | CFGFLAG_CLIENT | CFGFLAG_INSENSITIVE, "Country of the player") MACRO_CONFIG_STR(Password, password, 32, "", CFGFLAG_CLIENT | CFGFLAG_SERVER | CFGFLAG_NONTEEHISTORIC, "Password to the server") MACRO_CONFIG_STR(Logfile, logfile, 128, "", CFGFLAG_SAVE | CFGFLAG_CLIENT | CFGFLAG_SERVER, "Filename to log all output to") +MACRO_CONFIG_INT(Loglevel, loglevel, 2, 0, 4, CFGFLAG_SAVE | CFGFLAG_CLIENT | CFGFLAG_SERVER, "Log level (0 = Error, 1 = Warn, 2 = Info, 3 = Debug, 4 = Trace)") MACRO_CONFIG_INT(ConsoleOutputLevel, console_output_level, 0, 0, 2, CFGFLAG_CLIENT | CFGFLAG_SERVER, "Adjusts the amount of information in the console") MACRO_CONFIG_INT(ConsoleEnableColors, console_enable_colors, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SERVER, "Enable colors in console output") MACRO_CONFIG_INT(Events, events, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT | CFGFLAG_SERVER, "Enable triggering of events, (eye emotes on some holidays in server, christmas skins in client).")