From 5a96672d7922faf9bb3e29d259a40d3483bfa4ba Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 21 Jan 2019 16:23:50 -0600 Subject: [PATCH] Log details of one-off label printing error, when they occur needed for troubleshooting --- tailbone/views/products.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tailbone/views/products.py b/tailbone/views/products.py index 9ee7a60c..3369e3e2 100644 --- a/tailbone/views/products.py +++ b/tailbone/views/products.py @@ -27,6 +27,7 @@ Product Views from __future__ import unicode_literals, absolute_import import re +import logging import six import sqlalchemy as sa @@ -52,6 +53,9 @@ from tailbone.progress import SessionProgress from tailbone.util import raw_datetime +log = logging.getLogger(__name__) + + # TODO: For a moment I thought this was going to be necessary, but now I think # not. Leaving it around for a bit just in case... @@ -1169,6 +1173,7 @@ def print_labels(request): try: printer.print_labels([(product, quantity, {})]) except Exception as error: + log.warning("error occurred while printing labels", exc_info=True) return {'error': six.text_type(error)} return {}