From 851a2157622a43a9ae838ccde1396351fe46cd7a Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 11 May 2017 09:00:40 +0100 Subject: [PATCH] show wkhtmltopdf output when logging verbose --- md_pdf/build/pdf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/md_pdf/build/pdf.py b/md_pdf/build/pdf.py index cc6dbbb..12d7352 100644 --- a/md_pdf/build/pdf.py +++ b/md_pdf/build/pdf.py @@ -4,6 +4,7 @@ from md_pdf.build.cover import OUTPUT_COVER_FILE import os import logging + logger = logging.getLogger(__file__) @@ -14,7 +15,6 @@ STYLE_FILE = os.path.join(STATIC_DIR, 'style.css') HEADER_FILE = os.path.join(TEMPLATES_DIR, 'header.html') FOOTER_FILE = os.path.join(TEMPLATES_DIR, 'footer.html') PDF_OPTIONS = { - "quiet": "", "no-pdf-compression": "", "enable-internal-links": "", @@ -28,6 +28,8 @@ PDF_OPTIONS = { def export_pdf(content, config): + if logger.getEffectiveLevel() > logging.DEBUG: + PDF_OPTIONS['quiet'] = "" PDF_OPTIONS['title'] = config.get('title', 'Output') PDF_OPTIONS['replace'] = [(key, str(value)) for key, value in config['context'].items()]