1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-05 00:21:15 +03:00
WeasyPrint/weasyprint/logger.py

29 lines
634 B
Python
Raw Normal View History

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