From 41aa12ea73734ee34cdbc5ab22be35cd7780e43f Mon Sep 17 00:00:00 2001 From: sup39 Date: Tue, 26 Apr 2022 03:35:04 +0900 Subject: [PATCH] [GeckoConverter] fix logger --- GeckoConverter/convert.ipynb | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/GeckoConverter/convert.ipynb b/GeckoConverter/convert.ipynb index 35ad5eb..1b0cd97 100644 --- a/GeckoConverter/convert.ipynb +++ b/GeckoConverter/convert.ipynb @@ -9,7 +9,15 @@ "source": [ "import logging\n", "import struct\n", - "logger = logging.getLogger('Gecko')" + "import sys\n", + "# setup logger: stdout(=WARN)\n", + "logger = logging.getLogger('Gecko')\n", + "h = logging.StreamHandler(sys.stdout)\n", + "h.addFilter(lambda r: r.levelno < logging.WARN)\n", + "logger.addHandler(h)\n", + "h = logging.StreamHandler()\n", + "h.setLevel(logging.WARN)\n", + "logger.addHandler(h)" ] }, { @@ -327,7 +335,16 @@ "execution_count": 7, "id": "2a1645b1-0fa7-4603-b39f-c79ec42fd34c", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "041AE6B0: Unknown symbol: render__22TBathWaterFlatRendererFPQ26JDrama9TGraphicsRC12TBathtubDataPP10TBathWaterPP16TBathWaterParamsi\n", + "041AE6B0: Unknown symbol: render__22TBathWaterFlatRendererFPQ26JDrama9TGraphicsRC12TBathtubDataPP10TBathWaterPP16TBathWaterParamsi\n" + ] + } + ], "source": [ "logger.setLevel(logging.WARN)\n", "\n", @@ -337,7 +354,7 @@ " gecko = f.read()\n", "\n", "# convert the code from US to JP\n", - "ans = convertGecko(gecko, symLsts['US'], symMaps['JP'], knownAddrs={\n", + "ans = convertGecko(gecko, symLsts['US'], symMaps['EU'], knownAddrs={\n", " 0x800003E0,\n", " 0x800003E4,\n", " 0x800003E8,\n", @@ -367,14 +384,6 @@ "win32clipboard.CloseClipboard()" ] }, - { - "cell_type": "code", - "execution_count": null, - "id": "ae9de60e-db13-4641-b16b-56ba9ed9c028", - "metadata": {}, - "outputs": [], - "source": [] - }, { "cell_type": "code", "execution_count": null,