1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-04 16:07:57 +03:00
WeasyPrint/weasyprint/logger.py
Guillaume Ayoub b40ad461be Remove repeated copyright assignments in files
Everything is replaced by a more explicit message in the COPYRIGHT file.

Inspired by rust-lang/rust#43498 and rust-lang/rust#57108.
2020-01-02 14:10:09 +01:00

28 lines
837 B
Python

"""
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.
Logging levels are used for specific purposes:
- errors are used for unreachable or unusable external resources, including
unreachable stylesheets, unreachables images and unreadable images;
- warnings are used for unknown or bad HTML/CSS syntaxes, unreachable local
fonts and various non-fatal problems;
- infos are used to advertise rendering steps.
"""
import logging
LOGGER = logging.getLogger('weasyprint')
if not LOGGER.handlers: # pragma: no cover
LOGGER.setLevel(logging.WARNING)
LOGGER.addHandler(logging.NullHandler())
PROGRESS_LOGGER = logging.getLogger('weasyprint.progress')