From c7ea5271e43d890c27a039b66febefb9fa6a3d2c Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Thu, 31 May 2012 01:42:01 -0400 Subject: [PATCH] Add logging to converter.api --- apps/converter/api.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/converter/api.py b/apps/converter/api.py index fb6bfaa8ec..c09ce336aa 100644 --- a/apps/converter/api.py +++ b/apps/converter/api.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import os import subprocess import hashlib +import logging from django.utils.encoding import smart_str @@ -20,6 +21,8 @@ from .exceptions import OfficeConversionError, UnknownFileFormat HASH_FUNCTION = lambda x: hashlib.sha256(x).hexdigest() +logger = logging.getLogger(__name__) + def cache_cleanup(input_filepath, *args, **kwargs): try: @@ -100,9 +103,11 @@ def convert(input_filepath, output_filepath=None, cleanup_files=False, mimetype= def get_page_count(input_filepath): + logger.debug('office_converter: %s' % office_converter) if office_converter: try: office_converter.convert(input_filepath) + logger.debug('office_converter.exists: %s' % office_converter.exists) if office_converter.exists: input_filepath = office_converter.output_filepath