From e32e9895e5da0340188306a0c7814b173246e8b8 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Mon, 22 Feb 2021 23:30:49 -0500 Subject: [PATCH] Prepare logging! --- Adventure Game/adventure_game/__main__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Adventure Game/adventure_game/__main__.py b/Adventure Game/adventure_game/__main__.py index f035b1a..7422f06 100644 --- a/Adventure Game/adventure_game/__main__.py +++ b/Adventure Game/adventure_game/__main__.py @@ -1,5 +1,6 @@ import pathlib import npyscreen +import logging from npyscreen import NotEnoughSpaceForWidget from os import system @@ -19,12 +20,19 @@ class AlphaWarning(npyscreen.Popup): class AdventureGame(npyscreen.NPSAppManaged): + """ + This is the 'root' of the entire game! + """ # Do on creation def onStart(self): # Setup some important 'global' values we'll need later # Set the path all other files will follow self.mainPath = pathlib.Path(__file__).parent - + + # Setup logging + self.log = logging + self.log.basicConfig(filename=self.mainPath / 'logs/AdventureGame.log', filemode='w', level=logging.DEBUG) + # Parse world self.gamelib = parse( self.mainPath / 'gamedata/gamelib.yaml') # parse this data first (since it includes graphics for the main menu