so i followed a game building tutorial for python that is using pygame, i added some functionalties to it and it crashes after reaching a certain stage. I don't know which line is the problem so i implemented logging after reading a few tutorials about it, but i can't get the log file to show which line was the problem, i googled and the only code that actually showed it had try
and except
do i need to implement both of them in the game to be able to get the specific line? i am not sure if that will be efficent to do in a game. is there any way of making the log file inlcude the lines in it? Thanks! also i am new to coding, just putting it out there.
#logging config
logging.basicConfig(filename="log.txt", level=logging.DEBUG,filemode="w",format="%(asctime)s:%(levelname)s:%(message)s",datefmt="%d/%m/%Y %I:%M:%S %p")
#Logging
logging.debug('Debug Information')
logging.info('info Information')
logging.warning('warning Information')
logging.error('error Information')
logging.critical('critical Information')