From aa02706a34474eb108cf99f94396341e2709f045 Mon Sep 17 00:00:00 2001 From: Stefan Klug Date: Thu, 6 Jun 2024 11:58:33 +0200 Subject: libtuning: Migrate prints to python logging framework In ctt_ccm.py the logging functionality of the Cam object was used. As we don't want to port over that class, it needs to be replaced anyways. While at it, also replace the eprint function as it doesn't add any value over the logging framework and misses the ability for easy log formatting. For nice output formatting add the coloredlogs library. Signed-off-by: Stefan Klug Reviewed-by: Paul Elder Reviewed-by: Daniel Scally --- utils/tuning/libtuning/image.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'utils/tuning/libtuning/image.py') diff --git a/utils/tuning/libtuning/image.py b/utils/tuning/libtuning/image.py index 6ff60ec1..2c4d774f 100644 --- a/utils/tuning/libtuning/image.py +++ b/utils/tuning/libtuning/image.py @@ -13,6 +13,9 @@ import re import libtuning as lt import libtuning.utils as utils +import logging + +logger = logging.getLogger(__name__) class Image: @@ -25,13 +28,13 @@ class Image: try: self._load_metadata_exif() except Exception as e: - utils.eprint(f'Failed to load metadata from {self.path}: {e}') + logger.error(f'Failed to load metadata from {self.path}: {e}') raise e try: self._read_image_dng() except Exception as e: - utils.eprint(f'Failed to load image data from {self.path}: {e}') + logger.error(f'Failed to load image data from {self.path}: {e}') raise e @property -- cgit v1.2.1