1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-04 16:07:57 +03:00
WeasyPrint/weasyprint/logger.py
Simon Sapin c34221d215 2014.
2014-01-10 14:27:02 +00:00

29 lines
634 B
Python

# coding: utf8
"""
weasyprint.logging
------------------
Logging setup.
The rest of the code gets the logger through this module rather than
``logging.getLogger`` to make sure that it is configured.
:copyright: Copyright 2011-2014 Simon Sapin and contributors, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import division, unicode_literals
import logging
LOGGER = logging.getLogger('weasyprint')
# Default to logging to stderr.
if not LOGGER.handlers:
LOGGER.addHandler(logging.StreamHandler())
if LOGGER.level == logging.NOTSET:
LOGGER.setLevel(logging.INFO)