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