mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
crashes now show in log file
This commit is contained in:
@@ -102,6 +102,13 @@ def create_song_db():
|
|||||||
con.commit()
|
con.commit()
|
||||||
logger.info("Scores database created successfully")
|
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():
|
def main():
|
||||||
force_dedicated_gpu()
|
force_dedicated_gpu()
|
||||||
global_data.config = get_config()
|
global_data.config = get_config()
|
||||||
@@ -117,6 +124,7 @@ def main():
|
|||||||
level=log_level,
|
level=log_level,
|
||||||
handlers=[console_handler, file_handler]
|
handlers=[console_handler, file_handler]
|
||||||
)
|
)
|
||||||
|
sys.excepthook = handle_exception
|
||||||
logger.info("Starting PyTaiko")
|
logger.info("Starting PyTaiko")
|
||||||
|
|
||||||
logger.debug(f"Loaded config: {global_data.config}")
|
logger.debug(f"Loaded config: {global_data.config}")
|
||||||
|
|||||||
@@ -1208,7 +1208,7 @@ class ModifierSelector:
|
|||||||
setattr(global_data.modifiers[self.player_num], current_mod.name, not current_value)
|
setattr(global_data.modifiers[self.player_num], current_mod.name, not current_value)
|
||||||
self._start_text_animation(-1, current_value)
|
self._start_text_animation(-1, current_value)
|
||||||
elif current_mod.name == 'speed':
|
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)
|
setattr(global_data.modifiers[self.player_num], current_mod.name, new_value)
|
||||||
self._start_text_animation(-1, current_value)
|
self._start_text_animation(-1, current_value)
|
||||||
elif current_mod.name == 'random':
|
elif current_mod.name == 'random':
|
||||||
|
|||||||
Reference in New Issue
Block a user