Skip to content

Commit b5f2f4e

Browse files
committed
Read RLBOT_LOG_LEVEL env var
1 parent 7e1ba89 commit b5f2f4e

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

rlbot/utils/logging.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
import logging
2+
import os
23
import sys
34

45
DEFAULT_LOGGER_NAME = "rlbot"
56
DEFAULT_LOGGER = None
6-
LOGGING_LEVEL = logging.INFO
7+
8+
match os.environ.get("RLBOT_LOG_LEVEL"):
9+
case "debug":
10+
LOGGING_LEVEL = logging.DEBUG
11+
case "info":
12+
LOGGING_LEVEL = logging.INFO
13+
case "warn":
14+
LOGGING_LEVEL = logging.WARNING
15+
case "error":
16+
LOGGING_LEVEL = logging.ERROR
17+
case "critical":
18+
LOGGING_LEVEL = logging.CRITICAL
19+
case _:
20+
LOGGING_LEVEL = logging.INFO
721

822
logging.getLogger().setLevel(logging.NOTSET)
923

tests/default.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[rlbot]
22
# use this along with launcher = "custom"
33
# launcher_arg = "legendary"
4-
# "Steam", "Epic", "Custom"
4+
# "Steam", "Epic", "Custom", "NoLaunch"
55
launcher = "steam"
66
# Should RLBot start the bot processes automatically, or will a separate script start them
77
auto_start_bots = true

0 commit comments

Comments
 (0)