aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/constants.py1
-rw-r--r--bot/log.py5
2 files changed, 2 insertions, 4 deletions
diff --git a/bot/constants.py b/bot/constants.py
index 2b41b8a4..33bc8b61 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -135,6 +135,7 @@ class Client(NamedTuple):
prefix = environ.get("PREFIX", ".")
token = environ.get("BOT_TOKEN")
debug = environ.get("BOT_DEBUG", "true").lower() == "true"
+ file_logs = environ.get("FILE_LOGS", "false").lower() == "true"
github_bot_repo = "https://github.com/python-discord/sir-lancebot"
# Override seasonal locks: 1 (January) to 12 (December)
month_override = int(environ["MONTH_OVERRIDE"]) if "MONTH_OVERRIDE" in environ else None
diff --git a/bot/log.py b/bot/log.py
index 97561be4..29e696e0 100644
--- a/bot/log.py
+++ b/bot/log.py
@@ -20,10 +20,7 @@ def setup() -> None:
log_format = logging.Formatter(format_string)
root_logger = logging.getLogger()
- # Copied from constants file, which we can't import yet since loggers aren't instantiated
- debug = os.environ.get("BOT_DEBUG", "true").lower() == "true"
-
- if debug:
+ if Client.file_logs:
# Set up file logging
log_file = Path("logs/sir-lancebot.log")
log_file.parent.mkdir(exist_ok=True)