From 1147c1a718efac8ac185f5311b1d13ea9be52af7 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 6 Dec 2024 00:47:59 -0800 Subject: [PATCH] sc2: Removing unnecessary logging tabs --- worlds/sc2/client_gui.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/worlds/sc2/client_gui.py b/worlds/sc2/client_gui.py index 7c2a7e5b716d..fe681204783b 100644 --- a/worlds/sc2/client_gui.py +++ b/worlds/sc2/client_gui.py @@ -4,7 +4,7 @@ from BaseClasses import ItemClassification from NetUtils import JSONMessagePart -from kvui import GameManager, HoverBehavior, ServerToolTip, KivyJSONtoTextParser +from kvui import GameManager, HoverBehavior, ServerToolTip, KivyJSONtoTextParser, LogtoUI from kivy.app import App from kivy.clock import Clock from kivy.uix.gridlayout import GridLayout @@ -118,10 +118,6 @@ def _handle_text(self, node: JSONMessagePart): class SC2Manager(GameManager): - logging_pairs = [ - ("Client", "Archipelago"), - ("Starcraft2", "Starcraft2"), - ] base_title = "Archipelago Starcraft 2 Client" campaign_panel: Optional[MultiCampaignLayout] = None @@ -146,6 +142,8 @@ def on_start(self) -> None: warnings, window_width, window_height = gui_config.get_window_defaults() from kivy.core.window import Window Window.size = window_width, window_height + # Add the logging handler manually here instead of using `logging_pairs` to avoid adding 2 unnecessary tabs + logging.getLogger("Starcraft2").addHandler(LogtoUI(self.log_panels["All"].on_log)) for startup_warning in warnings: logging.getLogger("Starcraft2").warning(f"Startup WARNING: {startup_warning}") for race in (SC2Race.TERRAN, SC2Race.PROTOSS, SC2Race.ZERG):