From 5d94dec74c93542f44010734ef5b0bc3c9e3246c Mon Sep 17 00:00:00 2001 From: jeefo Date: Sun, 4 Jun 2023 22:19:08 +0300 Subject: [PATCH] logger: allow to disable logging into the file --- src/config.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/config.cpp b/src/config.cpp index b7f4311..35bd5b3 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -9,6 +9,7 @@ ConVar cv_bind_menu_key ("yb_bind_menu_key", "=", "Binds specified key for opening bots menu.", false); ConVar cv_ignore_cvars_on_changelevel ("yb_ignore_cvars_on_changelevel", "yb_quota,yb_autovacate", "Specifies comma separated list of bot cvars, that will not be overwritten by config on changelevel.", false); +ConVar cv_logger_disable_logfile ("yb_logger_disable_logfile", "0", "Disables logger to write anything to log file. Just spew content to the console."); BotConfig::BotConfig () { m_chat.resize (Chat::Count); @@ -99,7 +100,7 @@ void BotConfig::loadMainConfig (bool isFirstLoad) { game.serverCommand (strings.format ("%s cvars save", product.cmdPri)); } - // android is abit hard to play, lower the difficulty by default + // android is a bit hard to play, lower the difficulty by default if (plat.android && cv_difficulty.int_ () > 3) { cv_difficulty.set (3); } @@ -108,6 +109,9 @@ void BotConfig::loadMainConfig (bool isFirstLoad) { if (!game.isDedicated () && !strings.isEmpty (cv_bind_menu_key.str ())) { game.serverCommand ("bind \"%s\" \"yb menu\"", cv_bind_menu_key.str ()); } + + // disable logger if requested + logger.disableLogWrite (cv_logger_disable_logfile.bool_ ()); } void BotConfig::loadNamesConfig () {