Skip to content

Commit

Permalink
Merge pull request #44 from b4stien/fix-logging
Browse files Browse the repository at this point in the history
Fix logging (do not touch root logger)
  • Loading branch information
pmaupin committed Dec 13, 2015
2 parents 5c33301 + 8e6c6f0 commit 7c0f427
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pdfrw/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
import logging


logging.basicConfig(
format='[%(levelname)s] %(filename)s:%(lineno)d %(message)s',
level=logging.WARNING)
fmt = logging.Formatter('[%(levelname)s] %(filename)s:%(lineno)d %(message)s')

handler = logging.StreamHandler()
handler.setFormatter(fmt)

log = logging.getLogger('pdfrw')
log.setLevel(logging.WARNING)
log.addHandler(handler)


class PdfError(Exception):
Expand Down

0 comments on commit 7c0f427

Please sign in to comment.