From 4f7eb0548baec6658e31aa10f600640fb9543281 Mon Sep 17 00:00:00 2001 From: tudacs Date: Tue, 18 Dec 2018 08:22:50 +0100 Subject: [PATCH] Use logger instead of (dump) print --- sigal/image.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sigal/image.py b/sigal/image.py index 58fa53b..07e8bcd 100644 --- a/sigal/image.py +++ b/sigal/image.py @@ -235,6 +235,8 @@ def get_exif_data(filename): def get_iptc_data(filename): """Return a dict with the raw IPTC data.""" + logger = logging.getLogger(__name__) + iptc_data = {} # PILs IptcImagePlugin issues a SyntaxError in certain circumstances @@ -244,7 +246,7 @@ def get_iptc_data(filename): img = _read_image(filename) raw_iptc = IptcImagePlugin.getiptcinfo(img) except SyntaxError: - print("IPTC Error in %s\n"%filename) + logger.info('IPTC Error in %s',filename) # IPTC fields are catalogued in: # https://www.iptc.org/std/photometadata/specification/IPTC-PhotoMetadata