-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot_main.py
37 lines (28 loc) · 1.15 KB
/
bot_main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from typing import Dict, Any
import logging
from common.environments.interactive_game_runner import InteractiveGameRunner
from core.constants.logging import VERBOSE_LOG_LEVEL
from common.defaults.action_choice_players_default import ActionChoicePlayersDefault
def _configure_logging():
logging.basicConfig(
format='[%(levelname)s] %(message)s',
filename="bot_players_logging",
filemode="w",
level=VERBOSE_LOG_LEVEL)
logging.addLevelName(logging.CRITICAL, "FTL")
logging.addLevelName(logging.ERROR, "ERR")
logging.addLevelName(logging.WARNING, "WRN")
logging.addLevelName(logging.INFO, "INF")
logging.addLevelName(logging.DEBUG, "DBG")
logging.addLevelName(VERBOSE_LOG_LEVEL, "VRB")
logging.getLogger('asyncio').setLevel(logging.WARN)
logging.getLogger('').addHandler(logging.StreamHandler())
if __name__ == "__main__":
_configure_logging()
print("d[o_0]b Cavernabot initialising...\r\n")
game_runner: InteractiveGameRunner = InteractiveGameRunner(3, ActionChoicePlayersDefault())
try:
game_runner.run()
except:
logging.exception('')
raise