Skip to content

Commit

Permalink
fix: Improve PDF generation debug logs (#907)
Browse files Browse the repository at this point in the history
  • Loading branch information
kesara authored Oct 10, 2022
1 parent 45dd389 commit 08605de
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions xml2rfc/writers/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
import os
import re

import warnings

warnings.filterwarnings("ignore", message='@font-face support needs Pango >= 1.38')

try:
import weasyprint
Expand Down Expand Up @@ -50,6 +47,8 @@ def __init__(self, xmlrfc, quiet=None, options=default_options, date=None):
wplogger.setLevel(logging.CRITICAL)
elif self.options.verbose:
wplogger.setLevel(logging.WARNING)
elif self.options.debug:
wplogger.setLevel(logging.DEBUG)
else:
wplogger.setLevel(logging.ERROR)

Expand All @@ -59,6 +58,8 @@ def __init__(self, xmlrfc, quiet=None, options=default_options, date=None):
ftlogger.setLevel(logging.CRITICAL)
elif self.options.verbose:
ftlogger.setLevel(logging.WARNING)
elif self.options.debug:
ftlogger.setLevel(logging.DEBUG)
else:
ftlogger.setLevel(logging.ERROR)

Expand Down

0 comments on commit 08605de

Please sign in to comment.