Add logging to converter.api
This commit is contained in:
@@ -3,6 +3,7 @@ from __future__ import absolute_import
|
|||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import hashlib
|
import hashlib
|
||||||
|
import logging
|
||||||
|
|
||||||
from django.utils.encoding import smart_str
|
from django.utils.encoding import smart_str
|
||||||
|
|
||||||
@@ -20,6 +21,8 @@ from .exceptions import OfficeConversionError, UnknownFileFormat
|
|||||||
|
|
||||||
HASH_FUNCTION = lambda x: hashlib.sha256(x).hexdigest()
|
HASH_FUNCTION = lambda x: hashlib.sha256(x).hexdigest()
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def cache_cleanup(input_filepath, *args, **kwargs):
|
def cache_cleanup(input_filepath, *args, **kwargs):
|
||||||
try:
|
try:
|
||||||
@@ -100,9 +103,11 @@ def convert(input_filepath, output_filepath=None, cleanup_files=False, mimetype=
|
|||||||
|
|
||||||
|
|
||||||
def get_page_count(input_filepath):
|
def get_page_count(input_filepath):
|
||||||
|
logger.debug('office_converter: %s' % office_converter)
|
||||||
if office_converter:
|
if office_converter:
|
||||||
try:
|
try:
|
||||||
office_converter.convert(input_filepath)
|
office_converter.convert(input_filepath)
|
||||||
|
logger.debug('office_converter.exists: %s' % office_converter.exists)
|
||||||
if office_converter.exists:
|
if office_converter.exists:
|
||||||
input_filepath = office_converter.output_filepath
|
input_filepath = office_converter.output_filepath
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user