You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-python/rst2pdf/files/rst2pdf-0.93-fix-logging.patch

27 lines
771 B

--- rst2pdf/log.py
+++ rst2pdf/log.py
@@ -4,11 +4,12 @@
import logging
import sys
-logging.basicConfig(
- format='[%(levelname)s] %(filename)s:%(lineno)d %(message)s',
- level=logging.WARNING)
-
log = logging.getLogger('rst2pdf')
+_fmt = logging.Formatter('[%(levelname)s] %(filename)s:%(lineno)d %(message)s')
+_hdlr = logging.StreamHandler()
+_hdlr.setFormatter(_fmt)
+log.addHandler(_hdlr)
+log.setLevel(logging.WARNING)
def nodeid(node):
"""Given a node, tries to return a way to see where it was in the
@@ -23,4 +24,4 @@
if node.source: fname=str(node.source)
except:
pass
- return 'near line %s in file %s'%(line,fname)
\ No newline at end of file
+ return 'near line %s in file %s'%(line,fname)