Log through a GameLog autoload instead of print()

GameLog.debug() prints only in debug builds, and GameLog.warning() reports
problems such as unexpected server data or failed downloads.
This commit is contained in:
Sansan committed 2026-10-06 11:15:03 +02:00
1 parent 5cdec5cc8f
commit 5831e1e73d
20 files changed
+137 -89

No files matched your search

+10 -10
View File
@@ -41,7 +41,7 @@ var popup_backdrop: PopupBackdrop
func _ready() -> void:
popup_backdrop = PopupBackdrop.add_to(self, _popups())
if OS.has_feature("macos"):
print("is_mac")
GameLog.debug("is_mac")
top_bar.search_pressed.connect(show_search)
top_bar.sync_pressed.connect(sync_soundtracks)
top_bar.statistics_pressed.connect(get_statistics)
@@ -60,7 +60,7 @@ func _ready() -> void:
func _input(event: InputEvent) -> void:
if event is InputEventKey and event.pressed:
if event.alt_pressed && event.keycode == KEY_ENTER:
print("Alt + Enter pressed")
GameLog.debug("Alt + Enter pressed")
Settings.fullscreen = !Settings.fullscreen
if Settings.fullscreen == true:
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
@@ -77,44 +77,44 @@ func _popups() -> Array[PopupWindow]:
func show_search() -> void:
print("show_search")
GameLog.debug("show_search")
search_view.toggle()
func show_about() -> void:
print("show_about")
GameLog.debug("show_about")
about_window.open()
func show_shortcuts() -> void:
print("show_shortcuts")
GameLog.debug("show_shortcuts")
shortcuts_window.open()
func show_qr() -> void:
print("show_qr")
GameLog.debug("show_qr")
qr_window.open()
func get_statistics() -> void:
print("get_statistics")
GameLog.debug("get_statistics")
statistic_popup.visible = true
statistic_label.text = "Total amount of soundtracks in the playlist: " \
+ str(search_view.soundtracks.size())
func sync_soundtracks() -> void:
print("sync_soundtracks")
GameLog.debug("sync_soundtracks")
sync_window.start_sync()
func _on_sync_started() -> void:
print("_on_sync_started")
GameLog.debug("_on_sync_started")
top_bar.sync_button.disabled = false
quiz.lock_for_sync()
func _on_sync_finished() -> void:
print("_on_sync_finished")
GameLog.debug("_on_sync_finished")
search_view.get_list_of_soundtracks()
quiz.on_sync_finished()