Skip to content

Commit

Permalink
sc2: Removing unnecessary logging tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewMarinets committed Dec 6, 2024
1 parent fc83411 commit 1147c1a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions worlds/sc2/client_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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):
Expand Down

0 comments on commit 1147c1a

Please sign in to comment.