From 0faeb42e40f7eb72db15320ced52053f9646eb8f Mon Sep 17 00:00:00 2001 From: Benjamin Auquite Date: Tue, 26 Mar 2024 08:25:58 -0500 Subject: [PATCH] more logging --- .../PyKotor/src/pykotor/resource/formats/tpc/io_tga.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Libraries/PyKotor/src/pykotor/resource/formats/tpc/io_tga.py b/Libraries/PyKotor/src/pykotor/resource/formats/tpc/io_tga.py index 9a774f8f1..e5f8b962a 100644 --- a/Libraries/PyKotor/src/pykotor/resource/formats/tpc/io_tga.py +++ b/Libraries/PyKotor/src/pykotor/resource/formats/tpc/io_tga.py @@ -5,6 +5,8 @@ from enum import IntEnum from typing import TYPE_CHECKING +from utility.logger_util import get_root_logger + try: from PIL import Image pillow_available = True @@ -202,7 +204,7 @@ def _load_with_pillow( texture_format = TPCTextureFormat.RGBA new_img = img.convert("RGBA") # Ensure the image is in RGBA format else: # TODO: ??? - print(f"Unknown pillow TGA format '{img.mode}'") + get_root_logger().warning(f"Unknown pillow TGA format '{img.mode}'") texture_format = TPCTextureFormat.RGBA new_img = img.convert("RGBA") # Ensure the image is in RGBA format return @@ -300,7 +302,7 @@ def _load_with_custom_logic( # Set the texture format based on the bits per pixel datacode_name = next((c.name for c in _DataTypes if c.value == datatype_code), _DataTypes.NO_IMAGE_DATA.name) self._tpc.original_datatype_code = _DataTypes.__members__[datacode_name] - print("tga datatype_code:", datacode_name, "y_flipped:", y_flipped, "bits_per_pixel:", bits_per_pixel) + get_root_logger().debug("tga datatype_code:", datacode_name, "y_flipped:", y_flipped, "bits_per_pixel:", bits_per_pixel) texture_format = TPCTextureFormat.RGBA if bits_per_pixel == 32 else TPCTextureFormat.RGB self._tpc.set_data(width, height, [bytes(data)], texture_format)