crashes now show in log file

This commit is contained in:
Anthony Samms
2025-11-21 09:50:24 -05:00
parent 59753e5ea5
commit 840607e15e
2 changed files with 9 additions and 1 deletions

View File

@@ -102,6 +102,13 @@ def create_song_db():
con.commit()
logger.info("Scores database created successfully")
def handle_exception(exc_type, exc_value, exc_traceback):
"""Log uncaught exceptions"""
if issubclass(exc_type, KeyboardInterrupt):
sys.__excepthook__(exc_type, exc_value, exc_traceback)
return
logger.critical("Uncaught exception", exc_info=(exc_type, exc_value, exc_traceback))
def main():
force_dedicated_gpu()
global_data.config = get_config()
@@ -117,6 +124,7 @@ def main():
level=log_level,
handlers=[console_handler, file_handler]
)
sys.excepthook = handle_exception
logger.info("Starting PyTaiko")
logger.debug(f"Loaded config: {global_data.config}")

View File

@@ -1208,7 +1208,7 @@ class ModifierSelector:
setattr(global_data.modifiers[self.player_num], current_mod.name, not current_value)
self._start_text_animation(-1, current_value)
elif current_mod.name == 'speed':
new_value = max(0.1, (current_value*10 - 1))/10
new_value = max(1, (current_value*10 - 1))/10
setattr(global_data.modifiers[self.player_num], current_mod.name, new_value)
self._start_text_animation(-1, current_value)
elif current_mod.name == 'random':